What is the resolution for obtaining an access token via POSTMAN for the BOX API?
The documentation (http://developers.box.com/oauth/) suggests using POSTMAN or curl.
In this example, like the clientID is 123, secret code is 456 and so on.
I am using Postman. In a prior step, I have obtained an access code via: https://www.box.com/api/oauth2/authorize?response_type=code&client_id=123 let's say the response is 'xyz'. But here i am not gettitng response code and gettitng box login page to authorizr and when i am login with credential that is nothing happend.
In the next step, I use POSTMAN to issue a POST command (urlencoded) https://www.box.com/api/oauth2/token?grant_type=authorization_code&client_id=123&client_secret=456&code=xyz
I do all of this within 30 seconds of obtaining the code in step 1.
The error is {"error":"invalid_request","error_description":"Invalid grant_type parameter or parameter missing"}.
What is the resolution for obtaining an access token via POSTMAN for the BOX API?
-
Hi , I use PostMan to obtain dev access tokens in the following way:
1. I construct a URL with my client Id as a url Param as follows:
and save that as a request but really it's just so that I can copy and paste the url into a browser, login to box and in the address bar the token will be returned, which I copy and use in the next step in postman.
2. I then create another POST request with the following URL:
and the following header:
- Content-Type Application/x-www-form-urlencoded
- Accept application/json
and the following body elements:
- grant_type authorization_code
- client_id [CLIENT ID]
- client_secret [CLIENT SECRET]
- code [THE CODE YOU WOULD HAVE COPIED AT THE END OF STEP 1]
once you send this request you will be returned a dev access token.
Hope that helps.
Please sign in to leave a comment.
Comments
1 comment