APIs & Integrations

Michael_Fellows
Member

"Missing or invalid scope" when passing in contacts as required scope

Getting an error about missing or invalid scopes. Only requesting the ‘contacts’ scope. Any feedback on this?

This was working fine last week and is borked without any changes.

Here’s the url that initiates the oAuth handshake.
https://app.hubspot.com/oauth/authorize?client_id=<client_id>&scope=contacts&redirect_uri=<redirect_uri>

Response
"status":"BAD_SCOPES","message":"missing or invalid scopes","correlationId":"503ab336-e1d2-4324-8ebb-be2f29f224b6","requestId":"ecd667f1a9f434160564ae0397dccad9"

38 Replies 38
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

"Missing or invalid scope" when passing in contacts as required scope

Hi @SAPikachu,

Thank you for that info; in this case, I would suspect that the specific portal(s) you're seeing this error for authorized your integrations, and then downgraded to some lower product tier. This would mean that the refresh token you have is still valid, but they're likely missing one or more required scopes. If you direct message me a particular refresh token and your full authorization URL, I can investigate further.

SAPikachu
Member

"Missing or invalid scope" when passing in contacts as required scope

Just sent you a message, thanks!

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

"Missing or invalid scope" when passing in contacts as required scope

Hi @SAPikachu,

Do you see this error when using an existing refresh token to generate a new access token? Or when using an authorization code to generate a new access/refresh token? Can you send me a link to your developer portal?

0 Upvotes
SAPikachu
Member

"Missing or invalid scope" when passing in contacts as required scope

@Derek_Gervais We were using existing refresh token to generate access token. Link to our developer page: https://app.hubspot.com/developer/358710/application/38341

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

"Missing or invalid scope" when passing in contacts as required scope

Hi @davidkubovsky,

Let's back up a bit; what request are you making when you're getting the BAD SCOPES error? Is it when trying to refresh an access token, or when using the code to get a refresh and access token for the first time?

0 Upvotes
SAPikachu
Member

"Missing or invalid scope" when passing in contacts as required scope

Hi Derek, we are getting this when calling /oauth/v1/token to get access token. I just tested and here are diagnostic IDs in the response:

"correlationId":"f84666e9-93f9-41fe-a776-800e51635ee0",
"requestId":"a18e8a94c7651e9e2cd2969b563809c4"

I can send you the refresh token if needed.

0 Upvotes
Not applicable

"Missing or invalid scope" when passing in contacts as required scope

@Derek_Gervais could this be due to the fact that they currently don't have Website Pages activated?

image

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

"Missing or invalid scope" when passing in contacts as required scope

Hi @davidkubovsky,

That seems strange; I checked out that user's permissions, and it all checks out according to the scopes that brix is requesting. If that particular user is selecting the correct portal, I would expect the installation to succeed. I tested this out with a test user/portal that had identical permissions and I was able to successfully install the brix integration.

Can you give me any other details on the user/portal? Is it possible a different user was logged in, or that the user selected the wrong portal?

0 Upvotes
Not applicable

"Missing or invalid scope" when passing in contacts as required scope

They are running on Marketing Enterprise with these add ons

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

"Missing or invalid scope" when passing in contacts as required scope

Hi @davidkubovsky,

I think the issue here is that the user permissions you included only allow the user to edit the contacts they own. That permission isn't enough to grant full read/write permission to the brix integration, since that user would be authorizing the integration to make changes to contacts that they themselves do not have permission to edit.

Can you have a user with full contact view/edit permission authorize the integration? Or, you can give that user full edit permissions.

0 Upvotes
Not applicable

"Missing or invalid scope" when passing in contacts as required scope

@Derek_Gervais the user has full contact permissions and it still doesn't seem to work

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

"Missing or invalid scope" when passing in contacts as required scope

Hi @davidkubovsky,

Can you give me the Hub ID of the portal that is experiencing those errors? Is it possible that their access tokens are missing a scope required for an API you're trying to access?

Not applicable

"Missing or invalid scope" when passing in contacts as required scope

the Hub ID is 2349803 :slight_smile: I'm not sure about the access token but I know that in order to connect with the integration you only need these permissions

so usually these user settings allow anyone to connect with the integration:

@Derek_Gervais

0 Upvotes
Not applicable

"Missing or invalid scope" when passing in contacts as required scope

@Derek_Gervais

Our customer repeatedly gets this error message and is unable to connect the briX HubSpot integration to his portal

{
"success": false,
"message": "Error when calling API : [403] missing or invalid scopes",
"data": {
"code": 403,
"body": "{"status":"BAD_SCOPES","message":"missing or invalid scopes","correlationId":"6a5f5505-9745-43e1-bc02-505e70679e95","requestId":"7d7533a055b83f9fd91b4c0fa15cc874"}",
"headers": {
"date": "Fri, 09 Mar 2018 18:01:19 GMT",
"content-type": "application/json; charset=UTF-8",
"content-length": "163",
"connection": "close",
"set-cookie": [
"__cfduid=d20c957ffea526a55dfbea8e58a0eff001520618479; expires=Sat, 09-Mar-19 18:01:19 GMT; path=/; domain=.hubapi.com; HttpOnly"
],
"access-control-allow-credentials": "false",
"x-trace": "2B626D2A0EF168AA0E6A3D869D04CFA15B45CEC5BC000000000000000000",
"expect-ct": "max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"",
"server": "cloudflare",
"cf-ray": "3f8f7235cfe59598-IAD"
},
"response": {
"code": 403,
"headers": {
"date": "Fri, 09 Mar 2018 18:01:19 GMT",
"content-type": "application/json; charset=UTF-8",
"content-length": "163",
"connection": "close",
"set-cookie": [
"__cfduid=d20c957ffea526a55dfbea8e58a0eff001520618479; expires=Sat, 09-Mar-19 18:01:19 GMT; path=/; domain=.hubapi.com; HttpOnly"
],
"access-control-allow-credentials": "false",
"x-trace": "2B626D2A0EF168AA0E6A3D869D04CFA15B45CEC5BC000000000000000000",
"expect-ct": "max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"",
"server": "cloudflare",
"cf-ray": "3f8f7235cfe59598-IAD"
},
"body": "{"status":"BAD_SCOPES","message":"missing or invalid scopes","correlationId":"6a5f5505-9745-43e1-bc02-505e70679e95","requestId":"7d7533a055b83f9fd91b4c0fa15cc874"}"
},
"url": "",
"options": {}
},
"sentry": "9029a1a4bf8247c191779c67b6f6282f"
}

The user account has the required permissions to connect to the integration and the portal itself is running on Marketing Enterprise. Could you help resolve this issue?

Derek_Gervais
HubSpot Alumni
HubSpot Alumni

"Missing or invalid scope" when passing in contacts as required scope

Hi @stevenwadejr,

I’m not running into any errors with the contacts scope. Can you double check that all the scopes that are checked off in your app settings are included in your initialization URL?

0 Upvotes
Not applicable

"Missing or invalid scope" when passing in contacts as required scope

I’m getting this error every time in our production integration at Help Scout. Our customers aren’t able to install or connect the integration because of this error. No code changes have been made and the app has been working fine since June.

@Derek_Gervais any idea what the root of this is and when we can expect a fix?

0 Upvotes
Luis_Braga
Member

"Missing or invalid scope" when passing in contacts as required scope

Some of our clients are still getting this error.
Will direct message Derek with the details if necessary.

0 Upvotes
silicium
Member

"Missing or invalid scope" when passing in contacts as required scope

Working now.
Strange…

0 Upvotes
silicium
Member

"Missing or invalid scope" when passing in contacts as required scope

Hello,

Seems like it happened again…
What’s going on?

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

"Missing or invalid scope" when passing in contacts as required scope

Hi all,

The team recently rolled back changes made to the OAuth system, so this issue should now be resolved. If people experiencing this issue could direct message me with their client ID and refresh token it would help us track down the issue going forward.

0 Upvotes