I’m backend developer integrating my company’s website to our HubSpot account. I’m using the HS API to update our HS contacts & companies with changes from our website, no problem.
I also want to update our website data with changes made directly by our support staff on our HubSpot account. I use webhooks for that, with the OAUTH flow, etc, and that works when I manually subscribe to events through the HubSpot page for our account.
However, I need to be able to create event subscriptions programmatically through the API. I think my code is good, but I get the scopes exception error:
"HubSpot\Client\Webhooks\ApiException: [403] Client error: `POST https://api.hubapi.com/webhooks/v3/xxx/subscriptions?hapikey=xxx` resulted in a `403 Forbidden` response:
{"status":"error","message":"This app hasn't been granted all required scopes to make this call. Read more about required scopes here: https://developers.hubspot.com/scopes."
I initially had just the “contacts” scope in my OAUTH configuration for the app, I deleted & re-created the URL & request in the application page with the additional scopes ‘integration-sync’, ‘crm.import’ & ‘oauth’ as well as ‘contacts’, regenerated the access & refresh tokens, but I still get the same error.
Am I missing a required scope, or am I missing a required step?