APIs & Integrations

siva
Member

Unable to authorize for Email and EmailEvents API

We are unable to authorize for content scope though the content scope is specified in the optional scope of access request URL. The authorizing user has administrator, marketing administrator and sales administrator privileges.

Request URL:
https://app.hubspot.com/oauth//authorize?optional_scope=content%20social%20automation%20timeline&scope=contacts&client_id=&response_type=code

Response:

{“token”:"",“user”:“smanoharan@aaa.com”,“hub_domain”:"<>",“scopes”:[“contacts”,“social”,“automation”,“timeline”,“oauth”],“hub_id”:<>,“app_id”:28836,“expires_in”:21599,“user_id”:3947160,“token_type”:“access”}

could anyone helpus where it could have gone wrong

0 Upvotes
9 Replies 9
richard-clark
Member

Unable to authorize for Email and EmailEvents API

@pmanca I’m seeing the same issue—I’m unable to receive access to the content scope when an admin user for an Enterprise client authorizes my app, and as a result I’m unable to access the EmailEvents API. Were you able to confirm that COS is necessary for Enterprise accounts to access this API?

In case it’s helpful, this is the URL I’m redirecting to to start the authorization flow:

https://app.hubspot.com/oauth/authorize?client_id=<client-id>&optional_scope=content%20reports%20automation%20forms&redirect_uri=<redirect-uri>&scope=contacts&state=<state>

For this particular user, I receive access to all optional scopes except content. I’ve confirmed that for my Hubspot Trial account, I receive access to all optional scopes.

If I do try to use the resulting access token to access the EmailEvents API (for the Enterprise user without the content scope), this is the response that I receive:

{
  "status":"error",
  "message":"This oauth-token <...> does not have proper permissions! (requires any of [email-access])",
  "correlationId":"dcc8b365-afe9-4a72-9615-6d7365669148",
  "requestId":"cd0c45238cfc096d1ffd06c3c2862c8d"
}

Thanks in advance!

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Unable to authorize for Email and EmailEvents API

@richard-clark I heard back from the Team lead on our Authorization engineering team and she mentioned that the content scope will need to be required when and can’t be an optional scope. Can you please try moving your request of the scope from optional to required and see if that helps?

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Unable to authorize for Email and EmailEvents API

To clarify for future readers as well. The portal must have access to both email and the COS in order to leverage the content scope.

0 Upvotes
Not applicable

Unable to authorize for Email and EmailEvents API

pmanca thanks a lot for information. been having same issues (also having health issues and so i’m searching for online pharmacy reviews as well now, but that’s another story). i see you really know these things so would you mind if i would have some questions for you in the future? thanks!
and yeah, thanks for this either:

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Unable to authorize for Email and EmailEvents API

@Listow If you have any future questions the best thing to do is to create a new forum post and I or someone else will be happy to assist

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Unable to authorize for Email and EmailEvents API

@siva Just out of curiosity do you have the website add-on?

0 Upvotes
siva
Member

Unable to authorize for Email and EmailEvents API

our Hubspot subscription is enterprise and I could see desin manager, file manager, landing pages, blog and email. I hope you mean this only.

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Unable to authorize for Email and EmailEvents API

@siva the COS is the add-on to fully host your site and is not included in Enterprise. I am wondering if you need that as well and our documentation needs to be updated.

0 Upvotes
siva
Member

Unable to authorize for Email and EmailEvents API

@pmanca, we are just trying to use the Email and EmailEvent API to do some analysis and reporting with our other systems data. so, COS is required to use that API

0 Upvotes