Update push notification service settings
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.enabled
istrue
. -
The name of the sound to play when a new message is added to a conversation and
new_message.enabled
istrue
. -
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.enabled
istrue
. -
The name of the sound to play when a participant is added to a conversation and
added_to_conversation.enabled
istrue
. -
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.enabled
istrue
. -
The name of the sound to play to a user when they are removed from a conversation and
removed_from_conversation.enabled
istrue
. -
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.enabled
istrue
.
curl \
--request POST 'https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Configuration/Notifications' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'LogEnabled=true&NewMessage.Sound=ring&NewMessage.Enabled=false&NewMessage.Template=You+have+a+new+message+in+%24%7BCONVERSATION%7D+from+%24%7BPARTICIPANT%7D%3A+%24%7BMESSAGE%7D&AddedToConversation.Sound=ring&AddedToConversation.Enabled=false&AddedToConversation.Template=You+have+been+added+to+a+Conversation%3A+%24%7BCONVERSATION%7D&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&RemovedFromConversation.Sound=ring&RemovedFromConversation.Enabled=false&RemovedFromConversation.Template=You+have+been+removed+from+a+Conversation%3A+%24%7BCONVERSATION%7D'
{"LogEnabled"=>true, "NewMessage.Sound"=>"ring", "NewMessage.Enabled"=>false, "NewMessage.Template"=>"You have a new message in ${CONVERSATION} from ${PARTICIPANT}: ${MESSAGE}", "AddedToConversation.Sound"=>"ring", "AddedToConversation.Enabled"=>false, "AddedToConversation.Template"=>"You have been added to a Conversation: ${CONVERSATION}", "NewMessage.BadgeCountEnabled"=>true, "NewMessage.WithMedia.Enabled"=>false, "NewMessage.WithMedia.Template"=>"You have a new message in ${CONVERSATION} with ${MEDIA_COUNT} media files: ${MEDIA}", "RemovedFromConversation.Sound"=>"ring", "RemovedFromConversation.Enabled"=>false, "RemovedFromConversation.Template"=>"You have been removed from a Conversation: ${CONVERSATION}"}
{
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration/Notifications",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"log_enabled": true,
"new_message": {
"sound": "ring",
"enabled": false,
"template": "You have a new message in ${CONVERSATION} from ${PARTICIPANT}: ${MESSAGE}",
"with_media": {
"enabled": false,
"template": "You have a new message in ${CONVERSATION} with ${MEDIA_COUNT} media files: ${MEDIA}"
},
"badge_count_enabled": true
},
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"added_to_conversation": {
"sound": "ring",
"enabled": false,
"template": "You have been added to a Conversation: ${CONVERSATION}"
},
"removed_from_conversation": {
"sound": "ring",
"enabled": false,
"template": "You have been removed from a Conversation: ${CONVERSATION}"
}
}