# Permissions Error when using API - Campaign

**URL:** <https://community.hubspot.com/t/permissions-error-when-using-api-campaign/11826>\
**Category:** APIs & Integrations\
**Tags:** oauth\
**Created:** [September 8, 2017, 9:21am UTC](https://community.hubspot.com/t/permissions-error-when-using-api-campaign/11826 "2017-09-08T09:21:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [September 8, 2017, 9:21am UTC](https://community.hubspot.com/t/permissions-error-when-using-api-campaign/11826/1 "2017-09-08T09:21:08Z")

</div>

Hi,

We are receiving the below error when we attempt to retrieve some information from the campaign entity in Hubspot Marketing to display in our MSDCRM system. We are using KingswaySoft as an integration connector.

The issue appears to be with permissions, but the user in question is a ‘superadmin’. We have tested the functionality on the public test account and it works fine there, so we have concluded that there is a permissions issue in our portal.

Can you please advise?

[HubSpot Source [2]] Error: An error occurred with the following error message: "rhj: The remote server returned an error: (403) Forbidden. (Error Type / Reason: Forbidden, Detailed Message: {“status”:“error”,“message”:“This oauth-token (_123456789_) does not have proper permissions! (requires any of [email-access])”,“correlationId”:“_123456789_”,“requestId”:“_123456789_”}) (SSIS Integration Toolkit for HubSpot, v4.0.0.591 - DtsDebugHost, v14.0.500.272)System.Net.WebException

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [September 8, 2017, 10:06am UTC](https://community.hubspot.com/t/permissions-error-when-using-api-campaign/11826/2 "2017-09-08T10:06:48Z")

</div>

For reference the user in question has the below permissions.

[![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/6/8/68eb938fc9e775f9e0d99cfc0493f219c272ea18.png)

image.png1012x62 2.29 KB

]([https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/6/678be580d48a4694b6fcc639671103590838d75c.png](https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/6/678be580d48a4694b6fcc639671103590838d75c.png))

---

<div class="post-metadata">

**Author:** ![Derek\_Gervais](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/derek_gervais/32/17429_2.png) [@Derek\_Gervais](https://community.hubspot.com/u/Derek_Gervais)\
**Post date:** [September 8, 2017, 2:26pm UTC](https://community.hubspot.com/t/permissions-error-when-using-api-campaign/11826/3 "2017-09-08T14:26:56Z")

</div>

Hi [@Henry\_Lamborn](https://community.hubspot.com/u/henry_lamborn),

That error message isn’t referring to the user’s permissions, but rather the scopes of the Oauth token being used to make the request. It appears that when the token was generated, the `email-access` scope wasn’t requested (see below). Do you have any more information on the scopes that KingswaySoft is requesting when initiating the integration?  
 [developers.hubspot.com](https://developers.hubspot.com/docs/methods/oauth2/initiate-oauth-integration#scopes)

### [Initiate an Integration with Oauth 2.0](https://developers.hubspot.com/docs/methods/oauth2/initiate-oauth-integration#scopes)

[https://app.hubspot.com/oauth/authorize](https://app.hubspot.com/oauth/authorize) - Initiate authentication for an app using OAuth 2.0

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [September 12, 2017, 8:55am UTC](https://community.hubspot.com/t/permissions-error-when-using-api-campaign/11826/4 "2017-09-12T08:55:46Z")

</div>

I am forwarding this query to Kingswaysoft support however their HubSpot component is working perfectly fine with the HubSpot test account. I am using following hubspot test account.

Username: [testapi@hubspot.com](mailto:testapi@hubspot.com)  
Password: \*\*\*\*\*\*\*  
Hub ID: 62515

If the issue is due to the scope that KingswaySoft is requesting then it should not work with HubSpot test account too.

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [September 12, 2017, 1:34pm UTC](https://community.hubspot.com/t/permissions-error-when-using-api-campaign/11826/5 "2017-09-12T13:34:47Z")

</div>

“Reply from KingswaySoft”

Hi Irfan,

Please check the scope we are using below when authorize the OAuth token.

scope=contacts&optional\_scope=content reports social automation timeline forms files hubdb transactional-email

As you can see, we have content scope included which is the scope for Email and Email Events APIs.

Hope this has helped, please feel free to let us know if there is anything we can help with.

Thanks and Regards,

Chen Huang  
KingswaySoft Inc. | [http://www.kingswaysoft.com](http://www.kingswaysoft.com) | @kingswaysoft  
Toll-Free: 1.855.KingswaySoft (1.855.999.5288)  
Phone: 1.289.999.5288  
Follow us on Twitter | LinkedIn | Facebook | Google+ | YouTube

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [September 13, 2017, 8:22am UTC](https://community.hubspot.com/t/permissions-error-when-using-api-campaign/11826/6 "2017-09-13T08:22:51Z")

</div>

Hi,

we have done further investigation with the help of KingswaySoft and when we use HubSpot endpoint to check the oath token scope;

[https://api.hubapi.com/oauth/v1/access-tokens/{tokenID}](https://api.hubapi.com/oauth/v1/access-tokens/CMrE4dznKxICAQEY5aAxxxSwgwIozuABCccAQvuSE7RVr9Mj7OrCrESJmbNKd7OkL_Sm)

i.e.

[https://api.hubapi.com/oauth/v1/access-tokens/](https://api.hubapi.com/oauth/v1/access-tokens/){tokenID}

simply replace the {tokenID} with the access token value you get in the error message to check the scopes the token included.

we getting following result back;

{“token”:“CMrE4dznKxICAQEY5aAxxxSwgwIozuABCccAQvuSE7RVr9Mj7OrCrESJmbNKd7OkL\_Sm”,“user”:“example@abc.technologyabc.technology”,“hub\_domain”:“www.abc.technology”,“scopes”:[“contacts”,“oauth”],“hub\_id”:430\*\*\*,“app\_id”:28\*\*\*,“expires\_in”:21561,“user\_id”:4249ABC,“token\_type”:“access”}

---

<div class="post-metadata">

**Author:** ![Derek\_Gervais](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/derek_gervais/32/17429_2.png) [@Derek\_Gervais](https://community.hubspot.com/u/Derek_Gervais)\
**Post date:** [September 13, 2017, 3:22pm UTC](https://community.hubspot.com/t/permissions-error-when-using-api-campaign/11826/7 "2017-09-13T15:22:07Z")

</div>

Hi [@Henry\_Lamborn](https://community.hubspot.com/u/henry_lamborn),

So the error this post was referencing from the beginning occurs when an integration tries to access an API with a token lacking the proper scope(s). While it appears from the KingswaySoft response that they’re requesting the proper scopes, we can see from your investigating that the token doesn’t have the correct scopes. Based on the scopes they request, it’s missing all of the optional scopes that they request. Does the portal this integration is installed in have access to all of the relevant tools? Is it possible that this integration was authorized at a time when the portal did not have those tools or when the integration didn’t request those scopes? If the KingswaySoft integration is requesting all the correct scopes, you should be able to uninstall/reinstall the integration in order to re-authenticate and receive a new token with the proper scopes.

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [September 13, 2017, 5:27pm UTC](https://community.hubspot.com/t/permissions-error-when-using-api-campaign/11826/8 "2017-09-13T17:27:13Z")

</div>

The portal does have access to the relevant elements we are attempting to integrate and there have been no changes on its permissions i.e. we believe portal has access to all the tools required for this integration.

Also, new Auth token get generated every time when we run integration even if portal tools changed then integration should pick correct scope in next run.

Please follow the previous post as I have covered this is quite good details.

---

<div class="post-metadata">

**Author:** ![Derek\_Gervais](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/derek_gervais/32/17429_2.png) [@Derek\_Gervais](https://community.hubspot.com/u/Derek_Gervais)\
**Post date:** [September 13, 2017, 8:35pm UTC](https://community.hubspot.com/t/permissions-error-when-using-api-campaign/11826/9 "2017-09-13T20:35:40Z")

</div>

Hi [@Henry\_Lamborn](https://community.hubspot.com/u/henry_lamborn),

Can you direct message me with the user who authorized the integration and the Hub ID of the portal you’re installing the integration to? It would also help if KingswaySoft could send the URL of the request that is failing.

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [September 14, 2017, 10:56am UTC](https://community.hubspot.com/t/permissions-error-when-using-api-campaign/11826/10 "2017-09-14T10:56:10Z")

</div>

[irfan.saeed@intercity.technology](mailto:irfan.saeed@intercity.technology)

hub\_id":430181

{“token”:“_ExampleID_”,“user”:“irfan.saeed@intercity.technology”,“hub\_domain”:“www.intercity.technology”,“scopes”:[“contacts”,“oauth”],“hub\_id”:430181,“app\_id”:28750,“expires\_in”:19718,“user\_id”:4249604,“token\_type”:“access”}

---

<div class="post-metadata">

**Author:** ![Derek\_Gervais](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/derek_gervais/32/17429_2.png) [@Derek\_Gervais](https://community.hubspot.com/u/Derek_Gervais)\
**Post date:** [September 14, 2017, 5:09pm UTC](https://community.hubspot.com/t/permissions-error-when-using-api-campaign/11826/11 "2017-09-14T17:09:17Z")

</div>

Hi [@Henry\_Lamborn](https://community.hubspot.com/u/henry_lamborn),

I’ll message you directly to continue this conversation

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [February 15, 2018, 6:07pm UTC](https://community.hubspot.com/t/permissions-error-when-using-api-campaign/11826/12 "2018-02-15T18:07:40Z")

</div>

We just came across this thread and wanted to provide an update for any future searches.

It appeared that our software only included contacts scope during authorization and we fixed this issue in our v4.1 release on Oct 6, 2017:

- Fixed (v4.1): “Auth In App” option in HubSpot Connection Manager does not include all scopes during the authorization.

For the clients who are already on v4.1 or later, if your HubSpot portal does not have Campaigns then you may get the same error message, in which case you may want to double check if Marketing Enterprise is included in your portal.

Thank you,  
KingswaySoft
