ConversationsNotification

Update Service Notification

POST
/v1/Services/{ChatServiceSid}/Configuration/Notifications

Update push notification service settings

Authorization

accountSid_authToken
AuthorizationBasic <token>

In: header

Path Parameters

ChatServiceSid*string

The SID of the Conversation Service the Configuration applies to.

Match^IS[0-9a-fA-F]{32}$
Length34 <= length <= 34

Request Body

application/x-www-form-urlencoded

LogEnabled?boolean

Weather the notification logging is enabled.

NewMessage.Enabled?boolean

Whether to send a notification when a new message is added to a conversation. The default is false.

NewMessage.Template?string

The template to use to create the notification text displayed when a new message is added to a conversation and new_message.enabled is true.

NewMessage.Sound?string

The name of the sound to play when a new message is added to a conversation and new_message.enabled is true.

NewMessage.BadgeCountEnabled?boolean

Whether the new message badge is enabled. The default is false.

AddedToConversation.Enabled?boolean

Whether to send a notification when a participant is added to a conversation. The default is false.

AddedToConversation.Template?string

The template to use to create the notification text displayed when a participant is added to a conversation and added_to_conversation.enabled is true.

AddedToConversation.Sound?string

The name of the sound to play when a participant is added to a conversation and added_to_conversation.enabled is true.

RemovedFromConversation.Enabled?boolean

Whether to send a notification to a user when they are removed from a conversation. The default is false.

RemovedFromConversation.Template?string

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 is true.

RemovedFromConversation.Sound?string

The name of the sound to play to a user when they are removed from a conversation and removed_from_conversation.enabled is true.

NewMessage.WithMedia.Enabled?boolean

Whether to send a notification when a new message with media/file attachments is added to a conversation. The default is false.

NewMessage.WithMedia.Template?string

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 is true.

Response Body

application/json

curl -X POST "https://example.com/v1/Services/stringstringstringstringstringstri/Configuration/Notifications" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d '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.Template=You+have+a+new+message+in+%24%7BCONVERSATION%7D+with+%24%7BMEDIA_COUNT%7D+media+files%3A+%24%7BMEDIA%7D&AddedToConversation.Template=You+have+been+added+to+a+Conversation%3A+%24%7BCONVERSATION%7D&AddedToConversation.Sound=ring&RemovedFromConversation.Template=You+have+been+removed+from+a+Conversation%3A+%24%7BCONVERSATION%7D&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"}