Send a Direct Message
with custom profile
Send a Direct Message with custom profile
To attach a custom profile to a Direct Message add a
event.custom_profile_id
parameter to the POST
direct_messages/events/new.json request.
Note: See full documentation for all properties. Custom profiles can also be used with welcome messages.
Parameters¶
event.custom_profile_id | The string ID of the custom profile to attach to the Direct Message. |
Example Request¶
{
"event": {
"type": "message_create",
"message_create": {
"target": {
"recipient_id": "844385345234"
},
"message_data": {
"text": "Hi, my name is Jon. How can I help?",
},
"custom_profile_id": "100001"
}
}
}
Example request using Twurl¶
twurl -A 'Content-type: application/json' -X POST /1.1/direct_messages/events/new.json -d ' { "event": { "type": "message_create", "message_create": { "target": { "recipient_id": "844385345234" }, "message_data": { "text": "Hi, my name is Jon. How can I help?", }, "custom_profile_id": "100001" } } }'
Example Response¶
{
"event": {
"type": "message_create",
"message_create": {
"target": {
"recipient_id": "844385345234"
},
"sender_id": "1241124",
"message_data": {
"text": "Hi, my name is Jon. How can I help?",
},
"custom_profile_id": "100001"
}
}
}