メニュー

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Interaction (インタラクション)

Interactions are read-only communications logs of a given Session. Each Interaction represents a single communication.

Interactions are composed of an inbound (to Twilio) and an outbound (from Twilio) leg. Interactions can have both inbound and outbound legs or be "one-sided" (like when creating a Message Interaction resource).

If a user sends an SMS to a proxy number, and Twilio Proxy handles the proxying to the other Participant, you'll have an Interaction with both an inbound SMS and an outbound SMS.

Interaction properties

Names in PHP format
sid
sid<KI> Not PII

The unique string that we created to identify the Interaction resource.

sessionSid
sid<KC> Not PII

The SID of the parent Session resource.

serviceSid
sid<KS> Not PII

The SID of the parent Service resource.

accountSid
sid<AC> Not PII

The SID of the Account that created the Interaction resource.

data
文字列 PII MTL: 30 DAYS

A JSON string that includes the message body of message interactions (e.g. {"body": "hello"}) or the call duration (when available) of a call (e.g. {"duration": "5"}).

type
enum:type Not PII

The Type of the Interaction. Can be: message, voice or unknown.

inboundParticipantSid
sid<KP> Not PII

The SID of the inbound Participant resource.

inboundResourceSid
sid Not PII

The SID of the inbound resource; either the Call or [Message](https://www.twilio.com/docs/sms/api/message.

inboundResourceStatus
enum:resource_status Not PII

The inbound resource status of the Interaction. Can be: accepted, answered, busy, canceled, completed, deleted, delivered, delivery-unknown, failed, in-progress, initiated, no-answer, queued, received, receiving, ringing, scheduled, sending, sent, undelivered, or unknown.

inboundResourceType
文字列 Not PII

The inbound resource type. Can be Call or Message.

inboundResourceUrl
url Not PII

The URL of the Twilio inbound resource

outboundParticipantSid
sid<KP> Not PII

The SID of the outbound Participant).

outboundResourceSid
sid Not PII

The SID of the outbound resource; either the Call or Message.

outboundResourceStatus
enum:resource_status Not PII

The outbound resource status of the Interaction. Can be: accepted, answered, busy, canceled, completed, deleted, delivered, delivery-unknown, failed, in-progress, initiated, no-answer, queued, received, receiving, ringing, scheduled, sending, sent, undelivered, or unknown.

outboundResourceType
文字列 Not PII

The outbound resource type. Can be: Call or Message.

outboundResourceUrl
url Not PII

The URL of the Twilio outbound resource.

dateCreated
date_time<iso8601> Not PII

The ISO 8601 date and time in GMT when the Interaction was created.

dateUpdated
date_time<iso8601> Not PII

The ISO 8601 date and time in GMT when the resource was last updated.

url
url Not PII

The absolute URL of the Interaction resource.

Create an Interaction resource

You cannot POST to the Interactions resource. Instead, you can generate Interactions via the appropriate Participant's MessageInteraction resource. For details, see Sending Messages. Otherwise, Interactions are created automatically when Participants text or call each other.

Fetch an Interaction resource

GET
https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Interactions/{Sid}
パラメーター
Names in None format
service_sid
必須
GET sid<KS> Not PII

The SID of the parent Service of the resource to fetch.

session_sid
必須
GET sid<KC> Not PII

The SID of the parent Session of the resource to fetch.

sid
必須
GET sid<KI> Not PII

The Twilio-provided string that uniquely identifies the Interaction resource to fetch.

        
        
        
        

        Read multiple Interaction resources

        GET
        https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Interactions

        Retrieve a list of Interactions for a given Session.

        パラメーター
        Names in None format
        service_sid
        必須
        GET sid<KS> Not PII

        The SID of the parent Service to read the resources from.

        session_sid
        必須
        GET sid<KC> Not PII

        The SID of the parent Session to read the resources from.

              
              
              
              

              Delete an Interaction resource

              削除する
              https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Interactions/{Sid}

              Deleting an Interaction removes it permanently.

              Any Message or Call records created during this interaction will NOT be deleted automatically. If you want to delete all related Message/Call resources, you must issue direct DELETE requests for the inbound and outbound resources directly. Once you have deleted an interaction, those resource Sids will not be discoverable via Proxy.

              パラメーター
              Names in None format
              service_sid
              必須
              削除する sid<KS> Not PII

              The SID of the parent Service of the resource to delete.

              session_sid
              必須
              削除する sid<KC> Not PII

              The SID of the parent Session of the resource to delete.

              sid
              必須
              削除する sid<KI> Not PII

              The Twilio-provided string that uniquely identifies the Interaction resource to delete.

                    
                    
                    
                    
                    Rate this page:

                    ヘルプが必要ですか?

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