I don't have Postman installed, but I do have HttpRequester in Firefox, which is very similar.
Here is how to get the access token:
1. In the
URL field enter, the REST endpoint, which in my machine is:
http://localhost:320/workflow/oauth2/token
2. Under the
Content to Send tab, select "application/json" in the
Content Type dropdown.
3. Then, enter the login information in a JSON object. The client_id and client_secret are codes what are provided when registering the REST application.
For example:
Code: Select all{
"grant_type":"password",
"scope":"*",
"client_id":"HOQKNIVIKFQNTTSFQVWTZGGWACYGCIOJ",
"client_secret":"90292570959408213607a55003780929",
"username":"admin",
"password":"admin"
}
4. Then click on
POST to send the REST request. On the
RESPONSE side, it will return a JSON object containing an "access_token" if the login was successful. Copy the access token to use with subsequent REST requests.
HttpRequesterGetRESTToken.png (144.07 KiB) Viewed 4051 times
After obtaining the access token, it can be used to access the other REST endpoints:
1. Enter the address in the
URL field. For example:
http://localhost:320/api/1.0/workflow/cases
2. Under the
Headers tab, enter "Authorization" in the
Name field and "Bearer
access_token" in the Value field. Then click on
Add.
3. Finally, click on
GET,
POST,
PUT or
DELETE to send the REST request. On the
RESPONSE side, the
Status will be "200 OK" or "201 Created" if the REST request was handled correctly by the ProcessMaker server. If the REST endpoint returns a response, then the returned JSON object will appear In the textarea below the status. For example:
Code: Select all{
"app_uid": "24296209959419e86c97d56076641968",
"app_number": 353
}
HttpRequesterSendRESTRequest.png (121.3 KiB) Viewed 4051 times