A Service Notification resource manages a set of settings to determine push notification behavior at service level.
Update push notification service settings
Path parameters
-
The SID of the Conversation Service the Configuration applies to.
Minimum length is
34, maximum length is34. Format should match the following pattern:^IS[0-9a-fA-F]{32}$.
Body
-
Weather the notification logging is enabled.
-
Whether to send a notification when a new message is added to a conversation. The default is
false. -
The template to use to create the notification text displayed when a new message is added to a conversation and
new_message.enabledistrue. -
The name of the sound to play when a new message is added to a conversation and
new_message.enabledistrue. -
Whether the new message badge is enabled. The default is
false. -
Whether to send a notification when a participant is added to a conversation. The default is
false. -
The template to use to create the notification text displayed when a participant is added to a conversation and
added_to_conversation.enabledistrue. -
The name of the sound to play when a participant is added to a conversation and
added_to_conversation.enabledistrue. -
Whether to send a notification to a user when they are removed from a conversation. The default is
false. -
The template to use to create the notification text displayed to a user when they are removed from a conversation and
removed_from_conversation.enabledistrue. -
The name of the sound to play to a user when they are removed from a conversation and
removed_from_conversation.enabledistrue. -
Whether to send a notification when a new message with media/file attachments is added to a conversation. The default is
false. -
The template to use to create the notification text displayed when a new message with media/file attachments is added to a conversation and
new_message.attachments.enabledistrue.
curl \
--request POST 'https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Configuration/Notifications' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'NewMessage.Enabled=false&NewMessage.Template=You+have+a+new+message+in+%24%7BCONVERSATION%7D+from+%24%7BPARTICIPANT%7D%3A+%24%7BMESSAGE%7D&NewMessage.Sound=ring&NewMessage.BadgeCountEnabled=true&NewMessage.WithMedia.Enabled=false&NewMessage.WithMedia.Template=You+have+a+new+message+in+%24%7BCONVERSATION%7D+with+%24%7BMEDIA_COUNT%7D+media+files%3A+%24%7BMEDIA%7D&AddedToConversation.Enabled=false&AddedToConversation.Template=You+have+been+added+to+a+Conversation%3A+%24%7BCONVERSATION%7D&AddedToConversation.Sound=ring&RemovedFromConversation.Enabled=false&RemovedFromConversation.Template=You+have+been+removed+from+a+Conversation%3A+%24%7BCONVERSATION%7D&RemovedFromConversation.Sound=ring&LogEnabled=true'
{"NewMessage.Enabled" => false, "NewMessage.Template" => "You have a new message in ${CONVERSATION} from ${PARTICIPANT}: ${MESSAGE}", "NewMessage.Sound" => "ring", "NewMessage.BadgeCountEnabled" => true, "NewMessage.WithMedia.Enabled" => false, "NewMessage.WithMedia.Template" => "You have a new message in ${CONVERSATION} with ${MEDIA_COUNT} media files: ${MEDIA}", "AddedToConversation.Enabled" => false, "AddedToConversation.Template" => "You have been added to a Conversation: ${CONVERSATION}", "AddedToConversation.Sound" => "ring", "RemovedFromConversation.Enabled" => false, "RemovedFromConversation.Template" => "You have been removed from a Conversation: ${CONVERSATION}", "RemovedFromConversation.Sound" => "ring", "LogEnabled" => true}
{
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"log_enabled": true,
"added_to_conversation": {
"enabled": false,
"template": "You have been added to a Conversation: ${CONVERSATION}",
"sound": "ring"
},
"new_message": {
"enabled": false,
"template": "You have a new message in ${CONVERSATION} from ${PARTICIPANT}: ${MESSAGE}",
"badge_count_enabled": true,
"sound": "ring",
"with_media": {
"enabled": false,
"template": "You have a new message in ${CONVERSATION} with ${MEDIA_COUNT} media files: ${MEDIA}"
}
},
"removed_from_conversation": {
"enabled": false,
"template": "You have been removed from a Conversation: ${CONVERSATION}",
"sound": "ring"
},
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration/Notifications"
}