Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now

メニュー

Expand
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?

Session (セッション)

A Session is a single instance of two individuals communicating. It belongs to a Service and maps two Participants for a Proxy application. Sessions allow you to:

  • Specify a unique identifier relevant to your use case, such as a job ID
  • See whether a given Session is closed or not and the reason it has been closed
  • Control the length of time the Session should be active

Session properties

Names in Node.js format
sid
sid<KC> Not PII

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

serviceSid
sid<KS> Not PII

The SID of the Service the session is associated with.

accountSid
sid<AC> Not PII

The SID of the Account that created the Session resource.

dateStarted
date_time<iso8601> Not PII

The ISO 8601 date when the Session started.

dateEnded
date_time<iso8601> Not PII

The ISO 8601 date when the Session ended.

dateLastInteraction
date_time<iso8601> Not PII

The ISO 8601 date when the Session last had an interaction.

dateExpiry
date_time<iso8601> Not PII

The ISO 8601 date when the Session should expire. If this is value is present, it overrides the ttl value.

uniqueName
文字列 Not PII

An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. This value should not have PII.

status
enum:status Not PII

The status of the Session. Can be: open, in-progress, closed, failed, or unknown.

closedReason
文字列 Not PII

The reason the Session ended.

ttl
integer Not PII

The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction.

mode
enum:mode Not PII

The Mode of the Session. Can be: message-only, voice-only, or voice-and-message.

dateCreated
date_time<iso8601> Not PII

The ISO 8601 date and time in GMT when the resource 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 Session resource.

links
uri_map Not PII

The URLs of resources related to the Session.

Create a Session resource

post
https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions

Create a new Session.

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

The SID of the parent Service resource.

unique_name
オプション
post 文字列 Not PII

An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. This value should not have PII.

date_expiry
オプション
post date_time<iso8601> Not PII

The ISO 8601 date when the Session should expire. If this is value is present, it overrides the ttl value.

ttl
オプション
post integer Not PII

The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction.

mode
オプション
post enum:mode Not PII

The Mode of the Session. Can be: message-only, voice-only, or voice-and-message and the default value is voice-and-message.

status
オプション
post enum:status Not PII

The initial status of the Session. Can be: open, in-progress, closed, failed, or unknown. The default is open on create.

participants
オプション
post object[] Not PII

The Participant objects to include in the new session.

        
        
        
        

        Fetch a Session resource

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

        Retrieve a single Session.

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

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

        sid
        必須
        GET sid_like<KC> Not PII

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

              
              
              
              

              Read multiple Session resources

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

              Retrieve a list of all Sessions for a given Service.

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

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

                    
                    
                    
                    

                    Update a Session resource

                    post
                    https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{Sid}

                    Post updates to a given Session.

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

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

                    sid
                    必須
                    post sid<KC> Not PII

                    The Twilio-provided string that uniquely identifies the Session resource to update.

                    date_expiry
                    オプション
                    post date_time<iso8601> Not PII

                    The ISO 8601 date when the Session should expire. If this is value is present, it overrides the ttl value.

                    ttl
                    オプション
                    post integer Not PII

                    The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction.

                    status
                    オプション
                    post enum:status Not PII

                    The new status of the resource. Can be: in-progress to re-open a session or closed to close a session.

                    例 1
                          
                          
                          
                          

                          Delete a Session resource

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

                          Deleting a Session removes it permanently. Related Participants and Interactions will also be deleted.

                          Any Message or Call records created during interactions for this Session 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 of all child Interactions directly. Once you have deleted a Session, 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.

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

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

                                
                                
                                
                                
                                Rate this page:

                                ヘルプが必要ですか?

                                誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。