Oauth Token does not have proper permissions Issue


#1

Hi,

I am trying to get the list of blog posts from the HubSpot API and I get the following error -

(403) This oauth-token does not have proper permissions! (requires all of [content-access])

There is scope sent in the URL for Oauth creation -

scope=contacts&optional_scope=content%20reports%20social%20timeline%20business-intelligence

You will notice the content scope is already present in it.

Can you please let me know what else is required here?


#2

Have you tried putting "content" in scope instead of optional_scope?


#4

Welcome, @Kalyani.

The scopes your app requests in the scope and optional_scope parameters aren't necessarily the scopes that the OAuth token can access (especially when dealing with an optional_scope).

What is the Hub ID of the account throwing this error? Per this documentation, only accounts with paid Marketing Hub subscriptions have content access.


#5

Thanks Isaac, but the same query with the API key authentication works fine. Thats why I am confused.


#6

Hi @Kalyani, according to the same document that @Isaac_Takushi pointed out -
" Optional scopes will be automatically dropped from the authorization request if the user selects a HubSpot account that does not have access to that tool (such as requesting the social scope on a CRM only portal). If you're using optional scopes, you will need to check the access token or refresh token to see which scopes were granted."
You can check where things aren't working as they should.


#7

Hey, @Kalyani.

@dhirajpandey is correct. There are other factors at play than just including the scope in either the scope or optional_scope parameters. That's why I asked for the Hub ID you are attempting to connect to.

Could you also share:

  1. The name of the user who is trying to connect your app. (I'll want to check their permissions in the account.)
  2. The results of this endpoint (but do not include the token value)? We're looking for content in the scopes array.

#8

Hi Issac and Dhiraj,

Thanks for the input. I am working with one of our customers, I don't really have access to their details.
Let me investigate this further on my end and back to you with more details.

Thanks!


#9

Sounds good, @Kalyani! I look forward to hearing back from you.