Webhooks – Adding & Removing User Subscriptions

webhooks

#1

Hello

When I start a conversation via DM with, for example, @DennysDiner, I have not authorized any application. In the documentation we can read:

“each user must authenticate with your app to grant permission. To achieve this you must have a web app that implements Twitter Sign-in.”

The question is relative to the section “Adding & Removing User Subscriptions”.

Where do I indicate the user_id of the user who started a private conversation (DM) with my bot in order to subscribe his/her account to the webhook?

Thanks in advance


#2

HI @jbo,

The user is specified by the access tokens you include as part of the authorized request. You get the user access tokens as a result of having that user sign-in with Twitter to grant your app access.

However, you only need a webhook subscription for your bot account, not users interacting with it. Any message sent to your bot’s @username will be sent via that webhook subscription.

I can see where there may be confusion in how your quoted statement is phrased. We’ll clear that up.