メニュー

Expand
ページを評価:

Channels Subresource

This Twilio product is currently available as a Beta release. Some features are not yet implemented and others may be changed before the product is declared as Generally Available. Use of this Beta release is subject to the relevant terms of the applicable license agreement. Beta products are not covered by a Twilio SLA. Learn more about beta product support.

Flex Conversations requires Flex UI 2.0. If you are on Flex UI 1.x, please refer to Messaging in Flex pages.

The Interactions Channels subresource represents the communication channel associated with the interaction. An interaction channel may have multiple tasks associated with it but can only have one Twilio Conversation associated.

This subresource allows you to update the status of a channel but does not support creating a channel directly. Use the Interactions resource to create a channel.

When a channel is created through the Interactions resource, a task is created and is immediately routed to Flex using the supplied TaskRouter workspace.

InteractionChannel properties

Resource Properties in REST API format
sid
sid<UO> Not PII

The unique string created by Twilio to identify an Interaction Channel resource, prefixed with UO.

interaction_sid
sid<KD> Not PII

The unique string created by Twilio to identify an Interaction resource, prefixed with KD.

type
enum:type Not PII

The Interaction Channel's type. Can be: sms, email, chat, whatsapp, web. Note: These can be different from the task channel type specified in the Routing attributes. Task channel type corresponds to channel capacity while this channel type is the actual media type

status
enum:channel_status Not PII

The status of this channel.

error_code
integer? Not PII

The Twilio error code for a failed channel.

error_message
string? Not PII

The error message for a failed channel.

url
url Not PII

links
uri_map Not PII

パラメーター Sub-fields 概要
Status [required]

Indicates the interaction channel status. When a channel is set to closed, all tasks are put in "wrapping" state by default unless the Routing status is set to "closed" in which case the tasks will be "completed".


Value: closed
Routing [optional] The state of associated tasks. If not specified, all tasks will be set to “wrapping”.
status

Value: closed

If closed is specified, all associated tasks will be set to “completed”.

Fetch a Channel

GET
https://flex-api.twilio.com/v1/Interactions/{InteractionSid}/Channels/{Sid}

This lets you retrieve a single Channel instance.

パラメーター
Parameters in REST API format
interaction_sid
Path
GET sid<KD> Not PII

The unique string created by Twilio to identify an Interaction resource, prefixed with KD.

sid
Path
GET sid<UO> Not PII

The unique string created by Twilio to identify an Interaction Channel resource, prefixed with UO.

例 1
        
        
        

        List Channels

        GET /Interactions/<interaction_sid>/Channels

        Since only one Channel is supported in the private beta release, only one Channel will be returned.

        Response Object

        パラメーター 概要
        sid

        Unique identifier for the interaction channel

        interaction_sid

        Unique identifier for the interaction

        The channel type specified when the interaction was created. Please refer to the Interactions Properties table for possible values.
        Links A JSON object linking to the interaction channel's associated participants and invites
        例 2
              
              
              

              A channel is deleted after 180 days of inactivity regardless of state. Retrieving the channel after 180 days from deletion returns a 404 Not Found. Note that the initial TTL (Time to Live) period resets every time there is an update to the channel (e.g. adding and removing a participant, or updating the channel status).

              Close an Interaction Channel

              post
              https://flex-api.twilio.com/v1/Interactions/{InteractionSid}/Channels/{Sid}

              This subresource lets a developer close a channel in an interaction. When you close a channel, all tasks and reservations for all agents on the channel will be set to wrapup state. If you wish to complete the tasks, you can supply the optional routing status parameter with the value closed.

              Furthermore, when you set the channel status to closed, the underlying media channel will also be closed. This changes the channel to "read-only" regardless of the routing status.

              The following table illustrates the media channel and task states for a given Channel and Routing status.

              Channel status Routing status Resulting task state Resulting conversation state
              closed Not specified wrapping closed
              closed closed completed closed

              In some cases, it is desired to keep the channel open but have the agents complete their tasks. To achieve this, use the Channel Participant subresource to modify the status of the participants rather than the channel. Note however that you will need to add more logic to ensure you invite the same or a new agent on the next incoming message.

              パラメーター
              Parameters in REST API format
              interaction_sid
              Path
              post sid<KD> Not PII

              The unique string created by Twilio to identify an Interaction resource, prefixed with KD.

              sid
              Path
              post sid<UO> Not PII

              The unique string created by Twilio to identify an Interaction Channel resource, prefixed with UO.

              status
              必須
              post ienum:status Not PII

              Required. Indicates the Interaction channel's status. When a channel is set to closed, all tasks are put in the wrapping state by default unless the Routing status is set to closed in which case the tasks will be completed. Value: closed.

              routing
              オプション
              post オブジェクト Not PII

              Optional. The state of associated tasks. If not specified, all tasks will be set to wrapping.

              例 1
                    
                    
                    
                    例 2
                          
                          
                          
                          ページを評価:

                          ヘルプが必要ですか?

                          We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

                                
                                
                                

                                フィードバックくださりありがとうございます!

                                Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                                Sending your feedback...
                                🎉 Thank you for your feedback!
                                Something went wrong. Please try again.

                                Thanks for your feedback!

                                Refer us and get $10 in 3 simple steps!

                                ステップ1

                                Get link

                                Get a free personal referral link here

                                ステップ2:

                                Give $10

                                Your user signs up and upgrade using link

                                ステップ3

                                Get $10

                                1,250 free SMSes
                                OR 1,000 free voice mins
                                OR 12,000 chats
                                OR more