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).
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
When I click the Orange Request Token button I get a nice-looking response:
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
and having clicked the Orange Use Token button, I get a 401 (Unauthorised) error on the request.
Yet I can see that the access_token is passed in the request.