4

I am new to Sugar CRM ...and got a task to test the Rest api of sugar crm. I got an url , username ,password where i can login and view the page and it is working well. But while i am testing it with Postman for JSON response it is not giving me any response. Can anyone suggest me the right way to test the api...with an example or i am making the wrong url as request??

Here is document how to create the url http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_6.5/Application_Framework/Web_Services/REST/

And there is another problem of version. As i only got url to login how can i get the sugar version from webpage ??

Shakib_007
  • 51
  • 1
  • 5
  • `As i only got url to login how can i get the sugar version from webpage ??` Just fetch the file `/sugar_version.json` from Sugar. It tells you the version and flavor of Sugar in the convenient JSON format and doesn't require any login. – Jay Dec 11 '17 at 19:12

2 Answers2

1

Use this lovely feature of Postman Post the login info: POST /rest/v10/oauth2/token BODY

{
  "grant_type": "password",
  "client_id": "...",
  "client_secret": "",
  "username": "....",
  "password": "....",
  "platform": "...."
}

and in TESTS tab:

var jsonData = JSON.parse(responseBody);
postman.setEnvironmentVariable("OAuth-Token", jsonData.access_token);

now you have the token in your environment and you can use it in the header of other requests:

In your headers

LuisKarlos
  • 527
  • 6
  • 6
0

Hello If you want to use Postman to see your result of API , Following are the steps:

  1. You have to generate a access token for you sugar crm , so you have to write a code which will accept user name password and and generate the access code . You have to hit that api URL using postman which will generate the access token .
    Check this link

  2. Copy that access token in another tab of Postman , select AUth type and insert access token to it. then submit you URL you will get the result in Postman

Link 2

Amitesh Kumar
  • 3,051
  • 1
  • 26
  • 42