Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
NOTE: All requests must have a proper oAuth authorization header.
List all current welcome messages:
GET https://api.twitter.com/1.1/direct_messages/welcome_messages/rules/list.json
Create new template:
POST https://api.twitter.com/1.1/direct_messages/welcome_messages/new.json
Data: {
"welcome_message": {
"name": "init_welcome",
"message_data": {
"text": "Hi, I'm Shuga! What's up?",
"quick_reply": {
"type": "options",
"options": [
{
"label": "Let's chat.",
"description": "Talk to me for no particular reason.",
"metadata": "init_talk"
},
{
"label": "I need help!",
"description": "Request support for a Shuga Holdings-owned project.",
"metadata": "init_support"
},
{
"label": "I'm interested in commissions.",
"description": "Order custom banners, icons, and more.",
"metadata": "init_order"
},
{
"label": "Let's talk about
@SmashAdditions
.",
"description": "Submit manual request or ask some questions.",
"metadata": "init_smash"
}
]
}
}
}
}
Set template as welcome message:
POST https://api.twitter.com/1.1/direct_messages/welcome_messages/rules/new.json
Data: {
"welcome_message_rule": {
"welcome_message_id": "MESSAGE_ID_FROM_TEMPLATE_CREATION"
}
}
Delete welcome message rule:
DELETE https://api.twitter.com/1.1/direct_messages/welcome_messages/rules/destroy.json?id=MESSAGE_ID_FROM_TEMPLATE_CREATION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.