malcolm.murray

Using Postman to try out the REST APIs

Discussion created by malcolm.murray on May 24, 2017
Latest reply on Feb 6, 2018 by Peter Love

Has anyone had a play with postman to try out the REST APIS? I thought it might be nicer than a command-line solution like CURL (and has the advantage that it is easy to save and re-use queries).

https://www.getpostman.com

Having registered my own extension and then deployed the application on my server, I have managed to get it to create a token as follows

Creating a new GET or POST request and first selecting the Authorization Type to be OAUTH 2.0

 

If you click the Orange button Get New Access Token then a dialog box opens that should be populated as follows:

  • Token Name: anything_you_want
  • Auth URL: leave blank
  • Access Token URL: https://[your-server.com]/learn/api/public/v1/oauth2/token
  • Client ID: key set up when you defined your REST API
  • Client Secret: secret set up when you set up your REST API
  • Scope: leave blank
  • Grant Type: Client Credentials

I then ticked the box Request access token locally

token.jpg

 

When I click the Orange Request Token button I get a nice-looking response:

token_created.jpg

I have a token and an expiry time, all good so far.

 

When I then try and get some details of courses using the URL

https://[your-server.com]/learn/api/public/v1/courses?

and having clicked the Orange Use Token button, I get a 401 (Unauthorised) error on the request.

not auth.jpg

Yet I can see that the access_token is passed in the request.
Any suggestions?

 

TIA

 

Malcolm.

Outcomes