Error generating access token

SOLVED
Go to solution
Highlighted
Occasional Contributor

Error generating access token

I am currently receiving an error when trying to generate an access token via a custom application. My code has not changed and it has been working well for several years, but within the last two weeks I started getting {"error":"invalid_request","error_description":"Invalid grant_type parameter or parameter missing"}, which has made it impossible to use my custom app. I am using the correct endpoint as well, https://api.box.com/oauth2/token. Is anyone else having this issue? Has anyone been able to find a workaround? 

1 REPLY 1
Highlighted
Occasional Contributor

Re: Error generating access token

Per Box support, this issue was caused by a change on their end. When requesting the access the token, the header's content type must be set like 

    var headers = {
        'Content-Type': 'application/x-www-form-urlencoded'
    };
Hopefully this fixes things for anyone else experiencing this problem!