メニュー

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?

Stream Resource

A Stream is a pub-sub primitive that lets you broadcast JSON messages at a high rate to an elastic group of subscribers.

  • Messages are ephemeral - they can be published (created), but they cannot be queried, updated or deleted
  • The maximum Message payload size as serialized JSON is 4KB.
  • The maximum Message publishing rate per Stream is 30 per second.
  • Message delivery to remote endpoints is not guaranteed.
  • Messages may be received by remote endpoints in a different order than they were published.

See also Stream Message for information about the messages in a stream.

Sync Stream properties

Names in REST API format
sid
sid<TO> Not PII

The unique string that we created to identify the Sync Stream resource.

unique_name
文字列 PII MTL: 30 DAYS

An application-defined string that uniquely identifies the resource. It can be used in place of the resource's sid in the URL to address the resource.

account_sid
sid<AC> Not PII

The SID of the Account that created the Sync Stream resource.

service_sid
sid<IS> Not PII

The SID of the Sync Service the resource is associated with.

url
url Not PII

The absolute URL of the Message Stream resource.

links
uri_map Not PII

The URLs of the Stream's nested resources.

date_expires
date_time<iso8601> Not PII

The date and time in GMT when the Message Stream expires and will be deleted, specified in ISO 8601 format. If the Message Stream does not expire, this value is null. The Stream might not be deleted immediately after it expires.

date_created
date_time<iso8601> Not PII

The date and time in GMT when the resource was created specified in ISO 8601 format.

date_updated
date_time<iso8601> Not PII

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

created_by
文字列 PII MTL: 30 DAYS

The identity of the Stream's creator. If the Stream is created from the client SDK, the value matches the Access Token's identity field. If the Stream was created from the REST API, the value is 'system'.

Create a Sync Stream resource

post
https://sync.twilio.com/v1/Services/{ServiceSid}/Streams
パラメーター
Names in REST API format
service_sid
Path
post sid_like<IS> Not PII

The SID of the Sync Service to create the new Stream in.

unique_name
オプション
post 文字列 PII MTL: 30 DAYS

An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The unique_name value can be used as an alternative to the sid in the URL path to address the resource.

ttl
オプション
post integer Not PII

How long, in seconds, before the Stream expires and is deleted (time-to-live). Can be an integer from 0 to 31,536,000 (1 year). The default value is 0, which means the Stream does not expire. The Stream will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion.

例 1
        
        
        
        

        Fetch a Sync Stream resource

        GET
        https://sync.twilio.com/v1/Services/{ServiceSid}/Streams/{Sid}
        パラメーター
        Names in REST API format
        service_sid
        Path
        GET sid_like<IS> Not PII

        The SID of the Sync Service with the Sync Stream resource to fetch.

        sid
        Path
        GET sid_like<TO> Not PII

        The SID of the Stream resource to fetch.

        例 1
              
              
              
              

              Read multiple Sync Stream resources

              GET
              https://sync.twilio.com/v1/Services/{ServiceSid}/Streams

              Note: Without a PageSize query parameter, this will return only the first 50 Message Streams. Add a PageSize query parameter to fetch up to 100 items at once. The example has a PageSize value of 20.

              See paging for more information.

              パラメーター
              Names in REST API format
              service_sid
              Path
              GET sid_like<IS> Not PII

              The SID of the Sync Service with the Stream resources to read.

              例 1
                    
                    
                    
                    

                    Update a Sync Stream resource

                    post
                    https://sync.twilio.com/v1/Services/{ServiceSid}/Streams/{Sid}
                    パラメーター
                    Names in REST API format
                    service_sid
                    Path
                    post sid_like<IS> Not PII

                    The SID of the Sync Service with the Sync Stream resource to update.

                    sid
                    Path
                    post sid_like<TO> Not PII

                    The SID of the Stream resource to update.

                    ttl
                    オプション
                    post integer Not PII

                    How long, in seconds, before the Stream expires and is deleted (time-to-live). Can be an integer from 0 to 31,536,000 (1 year). The default value is 0, which means the Stream does not expire. The Stream will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion.

                    例 1
                          
                          
                          
                          

                          Delete a Sync Stream resource

                          削除する
                          https://sync.twilio.com/v1/Services/{ServiceSid}/Streams/{Sid}
                          パラメーター
                          Names in REST API format
                          service_sid
                          Path
                          削除する sid_like<IS> Not PII

                          The SID of the Sync Service with the Sync Stream resource to delete.

                          sid
                          Path
                          削除する sid_like<TO> Not PII

                          The SID of the Stream resource to delete.

                          例 1
                                
                                
                                
                                
                                Rate this page:

                                ヘルプが必要ですか?

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