Skip to content

Instantly share code, notes, and snippets.

@robinsloan
Created November 30, 2018 19:21
Show Gist options
  • Save robinsloan/2b3426085e006f30da78c68388f3185e to your computer and use it in GitHub Desktop.
Save robinsloan/2b3426085e006f30da78c68388f3185e to your computer and use it in GitHub Desktop.
Twitter DM autoresponder
# First,
twurl authorize --consumer-key YOUR_CONSUMER_KEY --consumer-secret YOUR_CONSUMER_SECRET
# Then,
twurl -A 'Content-type: application/json' -X POST /1.1/direct_messages/welcome_messages/new.json -d '{"welcome_message": {"name": "autoresponder", "message_data": {"text": "Hi! I am not currently checking DMs. You can email me instead 👉 YOUR EMAIL HERE"}}}'
# In the response, note the id of the returned welcome message object, because you'll need it in a moment.
# Finally,
twurl -A 'Content-type: application/json' -X POST /1.1/direct_messages/welcome_messages/rules/new.json -d '{"welcome_message_rule": {"welcome_message_id": "RETURNED_WELCOME_MESSAGE_OBJECT_ID"}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment