Webhook: Cancel Without Token

webhooks

#1

I’m working on a premium service that utilizes the direct messages webhooks. When someone cancels my service, I’d like to stop their webhook (especially since it’s limited at the time and it’s even more of a waste than usual). I’ve noticed when people cancel my other services they typically remove access to my app, sometimes before hand. I’m wondering how I can handle that? Will my hook be cancelled at the same time automatically or is there something I’ll have to do?


#2

Hey @DanielCHood,

If your customer cancels their service you can go ahead and remove the subscription with DELETE account_activity/webhooks/subscriptions.

If you’re customer revokes access to your app, the subscription will be in place, however you would no longer receive webhook events for that user. The webhook service checks permissions before events are sent to your app’s webhook.

If you would like just check what the user’s status is, you can hit GET account_activity/webhooks/subscriptions or just hit something like verify_credentials to check if the access tokens are still active.


#3

Thank you. I was aware of the methods in which to delete and check the status, I just wasn’t sure if the delete one would work in an instance of an expired token or something. I’m not too concerned with it especially since the events won’t take place. My concern was just that it would count against my quota and also that it would waste server resources receiving all the events of an expired user without being able to turn it off.