DM reply within webhook

webhooks

#1

Hi,

I would like to know the best practice to reply to a DM caught within the POST in the webhook code.

  1. use of DM API (https://api.twitter.com/1.1/direct_messages/events/new.json)
  2. directly return JSON from the POST (as long as it is possible)
  3. other…

thanks
Luca


#2

I’m not really sure what you mean by #2. I think you should use the DM API endpoint that you linked to in #1 but it’s probably not ideal to do that at the time of the postback being called. Your script that handles the postback/event/hook should be as simple as possible to execute quickly and avoid failure. I typically just queue events from there.


#3

Can you tell me how you linked webhook to the app?