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
Resource Properties in REST API format | |
---|---|
sid
|
The unique string that we created to identify the Sync Stream resource. |
unique_name
|
An application-defined string that uniquely identifies the resource. It can be used in place of the resource's |
account_sid
|
The SID of the Account that created the Sync Stream resource. |
service_sid
|
The SID of the Sync Service the resource is associated with. |
url
|
The absolute URL of the Message Stream resource. |
links
|
The URLs of the Stream's nested resources. |
date_expires
|
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 |
date_created
|
The date and time in GMT when the resource was created specified in ISO 8601 format. |
date_updated
|
The date and time in GMT when the resource was last updated specified in ISO 8601 format. |
created_by
|
The identity of the Stream's creator. If the Stream is created from the client SDK, the value matches the Access Token's |
Create a Sync Stream resource
https://sync.twilio.com/v1/Services/{ServiceSid}/Streams
パラメーター
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Sync Service to create the new Stream in. |
unique_name
オプション
|
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 |
ttl
オプション
|
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 |
例 1
Fetch a Sync Stream resource
https://sync.twilio.com/v1/Services/{ServiceSid}/Streams/{Sid}
パラメーター
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Sync Service with the Sync Stream resource to fetch. |
sid
Path
|
The SID of the Stream resource to fetch. |
例 1
Read multiple Sync Stream resources
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.
パラメーター
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Sync Service with the Stream resources to read. |
例 1
Update a Sync Stream resource
https://sync.twilio.com/v1/Services/{ServiceSid}/Streams/{Sid}
パラメーター
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Sync Service with the Sync Stream resource to update. |
sid
Path
|
The SID of the Stream resource to update. |
ttl
オプション
|
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 |
例 1
Delete a Sync Stream resource
https://sync.twilio.com/v1/Services/{ServiceSid}/Streams/{Sid}
パラメーター
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Sync Service with the Sync Stream resource to delete. |
sid
Path
|
The SID of the Stream resource to delete. |
例 1
ヘルプが必要ですか?
誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。