メニュー

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 PHP format
sid
sid<KC> Not PII

A 34 character string that uniquely identifies this Session.

serviceSid
sid<KS> Not PII

The unique SID identifier of the Service.

accountSid
sid<AC> Not PII

The unique SID identifier of the Account.

dateStarted
date_time<iso8601> Not PII

The date that this Session was started, given in ISO 8601 format.

dateEnded
date_time<iso8601> Not PII

The date that this Session was ended, given in ISO 8601 format.

dateLastInteraction
date_time<iso8601> Not PII

The date that this Session last had an interaction, given in ISO 8601 format.

dateExpiry
date_time<iso8601> Not PII

The date that this Session should expire, given in ISO 8601 format. If this is populated, it takes precedence over TTL values.

uniqueName
文字列 Not PII

An optional unique name or identifier for this Session, assigned by the developer, up to 255 characters. Should not contain PII.

status
enum:status Not PII

The Status of this Session. One of in-progress, closed, failed, unknown.

closedReason
文字列 Not PII

The reason this Session ended.

ttl
integer Not PII

The time, in seconds, after the latest of Session create time or the Session's last Interaction time at which the session will expire.

mode
enum:mode Not PII

The Mode of this Session. One of message-only, voice-only or voice-and-message.

dateCreated
date_time<iso8601> Not PII

The date that this Session was created, given in ISO 8601 format.

dateUpdated
date_time<iso8601> Not PII

The date that this Session was last updated, given in ISO 8601 format.

url
url Not PII

The URL of this resource.

links
uri_map Not PII

Contains a dictionary of URL links to nested resources of this 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 unique SID identifier of the parent Service.

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

Your unique identifier for this Session such as a Job ID or conversation ID. Should not contain PII.

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

An absolute time (ISO 8601) in the future at which this Session should close. If this is populated, it takes precedence over TTL values.

ttl
オプション
post integer Not PII

The time, in seconds, after the latest of Session create time or the Session's last Interaction time at which the session will expire.

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

The type of communications mediums allowed on a Session. Defaults to voice-and-message. Other options are voice-only or message-only.

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

Set this value to closed to close the session. A Session can be re-opened by posting to a closed session with the value in-progress. This will be open by default on create.

        
        
        
        

        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 unique SID identifier of the parent Service.

        sid
        必須
        GET sid_like<KC> Not PII

        A 34 character string that uniquely identifies this Session.

              
              
              
              

              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 unique SID identifier of the parent Service.

                    
                    
                    
                    

                    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 unique SID identifier of the parent Service.

                    sid
                    必須
                    post sid<KC> Not PII

                    A 34 character string that uniquely identifies this Session.

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

                    The date that this Session should expire, given in ISO 8601 format.

                    ttl
                    オプション
                    post integer Not PII

                    The time, in seconds, after the latest of Session create time or the Session's last Interaction time at which the session will expire.

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

                    The Status of this Session. Set to 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 unique SID identifier of the parent Service.

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

                          A 34 character string that uniquely identifies this Session.

                                
                                
                                
                                
                                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.