APIs & Integrations

KingswaySoft
Member

500 error when getting access token

After successfully getting the authorization code, our get access token call failed with 500 Internal Server error.

Here are the details:

App Id: 28750

{"status":"error","message":"internal error","correlationId":"0bceb5b5-f5d1-4fde-9d81-0864fc1677d9","requestId":"5dcad36e1775689997d46fbd66af764f"}

 

0 Upvotes
4 Replies 4
lscanlan
HubSpot Alumni
HubSpot Alumni

500 error when getting access token

Hi @KingswaySoft.

 

Are you still having issues with getting your refresh token and initial access token? I'm happy to take a look at what's going on. Could you let me know how you're making the request? Which URL are you making your request to? And how are you passing the authorization code? Just to confirm, you're using the endpoint documented here: https://developers.hubspot.com/docs/methods/oauth2/get-access-and-refresh-tokens, right? From that endpoint you can exchange your authorization code for the refresh token and an initial access token.

 

Leland Scanlan

HubSpot Developer Support
0 Upvotes
KingswaySoft
Member

500 error when getting access token

Hi @lscanlan , thanks for the reply. As mentioned above, this is actually a duplicate question of https://community.hubspot.com/t5/APIs-Integrations/Access-token-return-500-Internal-Server-Error/m-p.... We got response from HubSpot that our app would run into this 500 error with a certain user role when getting the access token. We used a different user as a workaround. Hope this is helpful to others who run into the same issue. 

0 Upvotes
patrick_sl
Member

500 error when getting access token

I was having this problem and it turns out that copying the secret and client form my app settings page included a newline, which was encoded into the request on postman. Took me a whole day to figure this out but yeah, I finally removed the encoded characters from the request and inspected the key-value fields and sure enough they had a newline. 

No more unknown internal server erorrs for me!

Maybe this will help you.

0 Upvotes
KingswaySoft
Member

500 error when getting access token

Hi @patrick_sl , thank you for your input. This is actually a duplicate question of https://community.hubspot.com/t5/APIs-Integrations/Access-token-return-500-Internal-Server-Error/m-p... We got response from HubSpot that our app would run into this 500 error with a certain user role when getting the access token. We used a different user as a workaround.

0 Upvotes