Update push notification service settings

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

A Service Notification resource manages a set of settings to determine push notification behavior at service level.

Update push notification service settings

Path parameters

  • ChatServiceSid string Required

    The SID of the Conversation Service the Configuration applies to.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^IS[0-9a-fA-F]{32}$.

application/x-www-form-urlencoded

Body

  • 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.

Responses

  • 200 application/json

    OK

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • account_sid string | null

      The unique ID of the Account responsible for this configuration.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • chat_service_sid string | null

      The SID of the Conversation Service the Configuration applies to.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^IS[0-9a-fA-F]{32}$.

    • new_message

      The Push Notification configuration for New Messages.

    • added_to_conversation

      The Push Notification configuration for being added to a Conversation.

    • removed_from_conversation

      The Push Notification configuration for being removed from a Conversation.

    • log_enabled boolean | null

      Weather the notification logging is enabled.

    • url string(uri) | null

      An absolute API resource URL for this configuration.

POST /v1/Services/{ChatServiceSid}/Configuration/Notifications
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'
Request example
{"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}"}
Response examples (200)
{
  "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}"
  }
}