Can't create a webhook subscription via API


#1

Hello!

I’m trying to create a webhook subscription via the API.
But the following command fails and the error “Sorry, you are not authorized to access this app”, and I don’t understand why.

curl -H "Content-Type: application/json" -XPOST "https://api.hubapi.com/webhooks/v1/35980/subscriptions?access_token=<<my-oath-access-token>>" -d '{ "subscriptionDetails" : { "subscriptionType" : "company.propertyChange", "propertyName" : "name" }, "enabled" : true }'

I also tried using a dev hapikey, and got the error “Unable to deduce user-id from this request.”

curl -H "Content-Type: application/json" -XPOST "https://api.hubaons?hapikey=<<my-hapi-key>>&user_id=<<my-user-id>>" -d '{ "subscriptionDetails" : { "subscriptionType" : "company.propertyChange", "propertyName" : "name" }, "enabled" : true }'

(tried with userid, user_id, user-id and userId)

Am I missing something? Is a special oauth scope needed for this, that’s missing from the docs?


#2

Hi @fonji

I’m seeing the same this with a test app. I’m passing this along to our platform team and I’ll reply here as soon as I have an update.


#3

Hi @dadams

Thank you for your answer and letting me know!
At least we can still manage those in the UI, but it will be great to automate the process.


#4

Hi @dadams,

Is there an update on this issue?


#5

Hi @dadams
Any updates on this issue.?


#6

This is being worked on now, it should be fixed soon. In the meantime, it should still be possible to create the webhook subscriptions through the Webhook Subscriptions tab inside the settings for your app.


#7

Hi Everyone,

This should be fixed, and you should be able to use the Developer HAPIkey from your developer portal to create webhook subscriptions for apps in that portal.


#8

Hi, @dadams
Great…!
Thanks for the update, But managing webhook via API is not triggering the event.
When an event happens in the application that event is not fired via API integration.


#9

@Veeresh_Digasangi what event type did you set the subscription for? Are you seeing anything in the logs for the webhook in your app, either success or failure?


#10

@dadams
I have set “contact.creation” event, It’s got validated properly and got 204 response. But the event is not fired at on time when a new contact is created.


#11

@Veeresh_Digasangi can you message me directly with more details for this? I’d need a link to the app that has the webhook setup and the Hub ID of a portal that has that app installed.