Problem in extracting access token after receiving authorization code

Highlighted
New Contributor

Problem in extracting access token after receiving authorization code

I am making a POST HTTP call on the following URL to extract the access token after receiving the authorization code …

https://www.box.com/api/oauth2/token?grant_type=authorization_code&client_id=CLIENT_ID&client_secret=CLIENT_SECRET&code=CODE&redirect_uri=http%3A//localhost

 

 

The response I am getting is the following JSON ...

{"error":"invalid_request","error_description":"Invalid grant_type parameter or parameter missing"}

 

 

Could someone please help me out? My registered redirect URI is http://localhost

 

6 REPLIES 6
Highlighted
New Contributor

Re: Problem in extracting access token after receiving authorization code

Well, I got it. I included the parameters in the post portion of the http call.

Highlighted
First-time Contributor

Re: Problem in extracting access token after receiving authorization code

How did yo uget this working? I have tried including the parameters both in the body, and also as query parameters. I have tried json encoding the body, etc, nothing works i get the same error for invalid request complaing about the missing or invalid grant type?

 

does the grant type need to be a query param and the other stuff need to be in the body?

Highlighted
New Contributor

Re: Problem in extracting access token after receiving authorization code

Did you ever get a solution to this? I have an app that was working but now is returning the 

"Invalid grant_type parameter or parameter missing" error. 
Thanks,
Kevin 
Highlighted
Occasional Contributor

Re: Problem in extracting access token after receiving authorization code

@kevincassidyds Same problem here - my code has been working fine for several years now and now all of the sudden I am receiving that error.

Highlighted
New Contributor

Re: Problem in extracting access token after receiving authorization code

I've had a ticket open with Box support for a week now and they're refusing to admit that there is an issue. You're the 4th person I've found on the Box community who is reporting the same issue.  

Highlighted
Occasional Contributor

Re: Problem in extracting access token after receiving authorization code

@kevincassidyds glad to hear I'm not alone. My company has not made any changes in regards to Box, so the problem must be somewhere on Box's end. Support is very slow, which is causing major delays for people in my company.