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


#21

Hello,

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


#22

Working now.
Strange…


#23

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


#24

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?


#25

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?


#26

@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?


#27

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?


#28

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


#29

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.


#30

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


#31

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?


#32

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

image


#33

They are running on Marketing Enterprise with these add ons


#34

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?


#35

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.


#36

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?


#37

@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


#38

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.


#39

Just sent you a message, thanks!