Intermittent "invalid_request" when requesting token
AnsweredAbout ever other time I attempt to retrieve a token from https://www.box.com/api/oauth2/token, I receive this error:
{"error":"invalid_request","error_description":"Invalid grant_type parameter or parameter missing"}
If I execute the exact same request again I get the correct response. Example without token:
{"access_token":"xyz","expires_in":4206,"restricted_to":[],"token_type":"bearer"}
I can provide our client ID or enterprise ID if that's helpful for looking at logs.
Thanks for any help.
-
Hi there,
It looks like the issue is that the correct endpoint to use for a token request is https://api.box.com/oauth2/token instead of https://www.box.com/api/oauth2/token as listed in the documentation here. Please try using this new endpoint to see if this resolves the issue, and if not, please feel free to submit a support ticket so that we can investigate this further.
Thank you for using the Box Community!
-
Thanks , I swapped out the URLs and made about 20 requests and that seems to work.
Do you have any idea why the other URL would work about 1/2 the time? And seemed to work all the time up until a couple weeks ago? Was https://www.box.com/api/oauth2/token recently deprecated?
Thanks again for the solution.
Matt
-
We’ve asked our Engineering team to investigate this issue. Meanwhile, the solution provided here will work and is aligned with our public documentation on our OAuth2 endpoint at https://developer.box.com
-
I also am using the "new" URL - have in fact been using it for ages, and am just now getting errors.
Is there any way to get an authorization token at all at the moment? I seem to be unable to do so, not just intermittently but permanently, which leaves my app "dead in the water".
Looks like i'm not the only one.
Box folks, could you please look into this as something that is buggy with the new URL (https://api.box.com/oauth2/token) rather than calling the issue solved?
My code was also working until recently and did not change.
thanks,
Please sign in to leave a comment.
Comments
10 comments