メニュー

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?

Sync REST: Message Streams

A Message 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 only be published and not 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.

プロパティ

Each Message Stream resource has the following properties. Unique name attribute is optional and allowed to be null.

Names in PHP format
sid
sid<TO> Not PII

The unique 34-character SID identifier of the Message Stream.

uniqueName
文字列 PII MTL: 30 DAYS

The unique and addressable name of this Message Stream. Optional, up to 320 characters long.

accountSid
sid<AC> Not PII

The unique SID identifier of the Twilio Account.

serviceSid
sid<IS> Not PII

The unique SID identifier of the Service Instance that hosts this Message Stream.

url
url Not PII

The absolute URL for this Message Stream.

links
uri_map Not PII

A dictionary of URL links to nested resources of this Stream.

dateExpires
date_time<iso8601> Not PII

Contains the date this Message Stream expires and gets deleted automatically. Contains null if the Stream persists permanently.

dateCreated
date_time<iso8601> Not PII

The date this Message Stream was created, given in UTC ISO 8601 format.

dateUpdated
date_time<iso8601> Not PII

Specifies the date this Message Stream was last updated, given in UTC ISO 8601 format.

createdBy
文字列 PII MTL: 30 DAYS

The identity of the Stream 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'.

{
  "account_sid": "ACxx",
  "service_sid": "ISxx",
  "sid": "TOxx",
  "unique_name": "MyStream",
  "date_created": "2015-11-24T22:18:57Z",
  "date_updated": "2015-11-24T22:18:57Z",
  "date_expires": null,
  "created_by": "system",
  "url": "https://sync.twilio.com/v1/Services/ISxx/Streams/TOxx",
  "links": {
    "messages": "https://sync.twilio.com/v1/Services/ISxx/Streams/TOxx/Messages"
  }
}

アクション


List All Message Streams

GET /v1/Services/ISxx/Streams

Retrieve a list of all Message Streams belonging to the Service Instance.

Note: By default, this will return the first 50 Message Streams. Supply a PageSize parameter to fetch up to 100 items at once. See paging for more information.

        
        
        
        

        Create a Message Stream

        POST /v1/Services/ISxx/Streams
        

        Create a new Message Stream in the Service Instance, optionally giving it a unique name and expiration deadline.

        パラメーター

        Names in PHP format
        uniqueName
        オプション
        post 文字列 PII MTL: 30 DAYS

        The unique and addressable name of this Stream. Optional, up to 320 characters long.

        ttl
        オプション
        post integer Not PII

        Time-to-live of this Stream in seconds, defaults to no expiration. In the range [1, 31 536 000 (1 year)], or 0 for infinity.

              
              
              
              

              Retrieve a Message Stream

              GET /v1/Services/ISxx/Streams/TOxx|UniqueName
              

              Fetch information about a specific Message Stream by its SID or unique name

              Example.

                    
                    
                    
                    

                    Publish Message to Stream

                    POST /v1/Services/ISxx/Streams/TOxx|UniqueName/Messages
                    

                    Publish a new message to the Message Stream. The message contains an arbitrary JSON object, serialized and percent-encoded for POST parameter submission.

                    パラメーター

                    Names in PHP format
                    data
                    必須
                    post オブジェクト PII MTL: 0 DAYS

                    The body of the Stream Message. Arbitrary JSON object, maximum size 4KB.

                          
                          
                          
                          

                          Update a Message Stream

                          POST /v1/Services/ISxx/Streams/TOxx|UniqueName
                          

                          Update the Message Stream expiration deadline, addressed by its SID or unique name.

                          パラメーター

                          Names in PHP format
                          ttl
                          オプション
                          post integer Not PII

                          New time-to-live of this Stream in seconds. In the range [1, 31 536 000 (1 year)], or 0 for infinity.

                                
                                
                                
                                

                                Delete a Message Stream

                                DELETE /v1/Services/ISxx/Streams/TOxx|UniqueName
                                

                                Permanently delete a specific Message Stream from current Service Instance, addressed by SID or unique name.

                                      
                                      
                                      
                                      
                                      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.