APIs & Integrations

tezrosolutions
Member

Missing or invalid scopes while getting OAuth 2.0 Access Token and Refresh Tokens

Hi Guys,

I am initiating an Oauth 2.0 connection and it successfully redirects to the redirect_uri provided. However when using the code to get access and refresh tokens from HubSpot API, it gives following error:

{“status”:“BAD_SCOPES”,“message”:“missing or invalid scopes”,“correlationId”:“c4b390af-e981-45a0-8ad5-6df19198c3cb”,“requestId”:“50c44d298a928c07c1283a2b66b69fc6”}

Detailed Response is here:
{“name”:“StatusCodeError”,“statusCode”:403,“message”:“403 - {“status”:“BAD_SCOPES”,“message”:“missing or invalid scopes”,“correlationId”:“c4b390af-e981-45a0-8ad5-6df19198c3cb”,“requestId”:“50c44d298a928c07c1283a2b66b69fc6”}”,“error”:{“status”:“BAD_SCOPES”,“message”:“missing or invalid scopes”,“correlationId”:“c4b390af-e981-45a0-8ad5-6df19198c3cb”,“requestId”:“50c44d298a928c07c1283a2b66b69fc6”},“options”:{“method”:“POST”,“form”:{“grant_type”:“authorization_code”,“client_id”:“fXXXa”,“client_secret”:“XXX”,“redirect_uri”:“https://us-central1-marketing-ninja.cloudfunctions.net/getAccessToken",“code”:“XXX”},“json”:true,“ur... or invalid scopes”,“correlationId”:“c4b390af-e981-45a0-8ad5-6df19198c3cb”,“requestId”:“50c44d298a928c07c1283a2b66b69fc6”},“headers”:{“access-control-allow-credentials”:“false”,“content-type”:“application/json; charset=UTF-8”,“x-trace”:“1BE69818E5F286715A703ED82C788CC1B0C0E9AA50D5ADD755A0A6B6C5”,“content-length”:“163”,“date”:“Mon, 20 Nov 2017 09:02:42 GMT”,“connection”:“close”},“request”:{“uri”:{“protocol”:“http:”,“slashes”:true,“auth”:null,“host”:“api.hubapi.com”,“port”:80,“hostname”:“api.hubapi.com”,“hash”:null,“search”:null,“query”:null,“pathname”:"/oauth/v1/token",“path”:"/oauth/v1/token",“href”:“http://api.hubapi.com/oauth/v1/token"},“method”:“POST”,“headers”:{“content-type”:“application/x-www-...”:230}}}}

Seems like something going on with HubSpot. Any pointers will be appreciated. Thanks in advance.

0 Upvotes
1 Reply 1
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Missing or invalid scopes while getting OAuth 2.0 Access Token and Refresh Tokens

Hi @_umairk,

If you were requesting the hubdb scope, it was likely related to a recent issue:

Hi everyone (@davidkubovsky @SAPikachu @serhat_sama1 @toopixel), This issue was resolved, and appeared again due to some remaining references to the old hubdb scopes. The scopes have now been updated, and should function correctly going forward. Re-authing the integrations should succeed in installing them. If anyone continues to see this issue going forward, feel free to update this thread.

0 Upvotes