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

oauth

#1

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,“url”:“http://api.hubapi.com/oauth/v1/token”,“qs”:{},“qsStringifyOptions”:{“arrayFormat”:“repeat”},“timeout”:15000,“simple”:true,“resolveWithFullResponse”:false,“transform2xxOnly”:false},“response”:{“statusCode”:403,“body”:{“status”:“BAD_SCOPES”,“message”:"missing 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-form-urlencoded”,“accept”:“application/json”,"content-length”:230}}}}

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


HubSpot Integration App Problem: You do not have the correct role to grant these permissions. Please contact your administrator
#2

Hi @_umairk,

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