Create a new webhook scoped to the conversation in a specific service
A Conversation-scoped Webhook resource manages a set of callback URLs and their configuration for receiving events specific to one conversation.
Create a new webhook scoped to the conversation in a specific service
Path parameters
-
The SID of the Conversation Service the Participant resource is associated with.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^IS[0-9a-fA-F]{32}$
. -
The unique ID of the Conversation for this webhook.
Body
-
The target of this webhook:
webhook
,studio
,trigger
Values are
webhook
,trigger
, orstudio
. -
The absolute url the webhook request should be sent to.
-
Values are
get
orpost
. -
The list of events, firing webhook event for this Conversation.
-
The list of keywords, firing webhook event for this Conversation.
-
The studio flow SID, where the webhook should be sent to.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^FW[0-9a-fA-F]{32}$
. -
The message index for which and it's successors the webhook will be replayed. Not set by default
curl \
--request POST 'https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Webhooks' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'Target=webhook&Configuration.Url=https%3A%2F%2Fexample.com&Configuration.Method=get&Configuration.Filters=onMessageSent&Configuration.Filters=onConversationDestroyed&Configuration.ReplayAfter=7'
{"Target"=>"webhook", "Configuration.Url"=>"https://example.com", "Configuration.Method"=>"get", "Configuration.Filters"=>["onMessageSent", "onConversationDestroyed"], "Configuration.ReplayAfter"=>7}
{
"sid": "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"target": "webhook",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"date_created": "2016-03-24T21:05:50Z",
"date_updated": "2016-03-24T21:05:50Z",
"configuration": {
"url": "https://example.com",
"method": "get",
"filters": [
"onMessageSent",
"onConversationDestroyed"
]
},
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}