Invite an Agent or a TaskQueue to a Channel.
Invite an Agent or a TaskQueue to a Channel.
Path parameters
-
The Interaction SID for this Channel.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^KD[0-9a-fA-F]{32}$
. -
The Channel SID for this Invite.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^UO[0-9a-fA-F]{32}$
.
POST
/v1/Interactions/{InteractionSid}/Channels/{ChannelSid}/Invites
curl \
--request POST 'https://flex-api.twilio.com/v1/Interactions/{InteractionSid}/Channels/{ChannelSid}/Invites' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'Routing=%7B%22properties%22%3A%7B%22workspace_sid%22%3A%22WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%22%2C%22workflow_sid%22%3A%22WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%22%2C%22worker_sid%22%3A%22WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%22%2C%22queue_sid%22%3A%22WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%22%2C%22attributes%22%3A%7B%22customerName%22%3A%22customer+name%22%2C%22customerAddress%22%3A%22customer+email+address%22%7D%7D%7D'
Request example
{"Routing"=>"{\"properties\":{\"workspace_sid\":\"WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"workflow_sid\":\"WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"worker_sid\":\"WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"queue_sid\":\"WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"attributes\":{\"customerName\":\"customer name\",\"customerAddress\":\"customer email address\"}}}"}
Response examples (201)
{
"sid": "KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"routing": {
"properties": {
"age": 0,
"sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"addons": "{}",
"reason": "",
"timeout": 86400,
"priority": 0,
"queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"attributes": "{\"customerAddress\":\"customer phone address\",\"flexChannelInviteSid\":\"KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"conversationSid\":\"CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"channelType\":\"sms\",\"customers\":{\"phone\":\"customer phone address\",\"name\":\"customer name\"},\"conversations\":{\"conversation_id\":\"KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"media\":[{\"type\":\"ChatTranscript\",\"sid\":\"CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"}]},\"customerName\":\"customer name\",\"flexInteractionChannelSid\":\"UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"flexInteractionSid\":\"KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"}",
"queue_name": "Sample Queue",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"age_in_queue": 0,
"date_created": 1634845217,
"date_updated": 1634845217,
"workflow_sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"workflow_name": "Default Fifo Workflow",
"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"routing_target": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"assignmentCounter": 0,
"assignment_status": "pending",
"task_queue_entered_date": 1634845217,
"task_channel_unique_name": "default"
},
"reservation": null
},
"channel_sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"interaction_sid": "KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}