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.
Resource properties sid
type: SID<TO>
The unique string that we created to identify the Sync Stream resource.
unique_name
type: string
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.
url
type: string<uri>
The absolute URL of the Message Stream resource.
links
type: object<uri-map>
The URLs of the Stream's nested resources.
date_expires
type: string<date-time>
The date and time in GMT when the Message Stream expires and will be deleted, specified in ISO 8601(link takes you to an external page) format. If the Message Stream does not expire, this value is null
. The Stream might not be deleted immediately after it expires.
date_created
type: string<date-time>
date_updated
type: string<date-time>
created_by
type: string
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'.
POST https://sync.twilio.com/v1/Services/{ServiceSid}/Streams
URI parameters Request body parameters UniqueName
type: string
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.
_11 // Download the helper library from https://www.twilio.com/docs/node/install
_11 // Find your Account SID and Auth Token at twilio.com/console
_11 // and set the environment variables. See http://twil.io/secure
_11 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11 const authToken = process.env.TWILIO_AUTH_TOKEN;
_11 const client = require('twilio')(accountSid, authToken);
_11 client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .then(sync_stream => console.log(sync_stream.sid));
_14 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "created_by": "created_by",
_14 "date_expires": "2015-07-30T21:00:00Z",
_14 "date_created": "2015-07-30T20:00:00Z",
_14 "date_updated": "2015-07-30T20:00:00Z",
_14 "messages": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams/TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages"
_14 "service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "sid": "TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "unique_name": "unique_name",
_14 "url": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams/TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
GET https://sync.twilio.com/v1/Services/{ServiceSid}/Streams/{Sid}
URI parameters Sid
type: string
The SID of the Stream resource to fetch.
_11 // Download the helper library from https://www.twilio.com/docs/node/install
_11 // Find your Account SID and Auth Token at twilio.com/console
_11 // and set the environment variables. See http://twil.io/secure
_11 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11 const authToken = process.env.TWILIO_AUTH_TOKEN;
_11 const client = require('twilio')(accountSid, authToken);
_11 client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .syncStreams('TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .then(sync_stream => console.log(sync_stream.uniqueName));
_14 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "created_by": "created_by",
_14 "date_expires": "2015-07-30T21:00:00Z",
_14 "date_created": "2015-07-30T20:00:00Z",
_14 "date_updated": "2015-07-30T20:00:00Z",
_14 "messages": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams/TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages"
_14 "service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "sid": "TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "unique_name": "unique_name",
_14 "url": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams/TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
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.
URI parameters PageSize
type: integer
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Page
type: integer
The page index. This value is simply for client state.
PageToken
type: string
The page token. This is provided by the API.
_11 // Download the helper library from https://www.twilio.com/docs/node/install
_11 // Find your Account SID and Auth Token at twilio.com/console
_11 // and set the environment variables. See http://twil.io/secure
_11 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11 const authToken = process.env.TWILIO_AUTH_TOKEN;
_11 const client = require('twilio')(accountSid, authToken);
_11 client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .then(syncStreams => syncStreams.forEach(s => console.log(s.sid)));
_27 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_27 "created_by": "created_by",
_27 "date_expires": "2015-07-30T21:00:00Z",
_27 "date_created": "2015-07-30T20:00:00Z",
_27 "date_updated": "2015-07-30T20:00:00Z",
_27 "messages": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams/TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages"
_27 "service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_27 "sid": "TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_27 "unique_name": "unique_name",
_27 "url": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams/TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_27 "first_page_url": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams?PageSize=50&Page=0",
_27 "next_page_url": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams?PageSize=50&Page=1",
_27 "previous_page_url": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams?PageSize=50&Page=0",
_27 "url": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams?PageSize=50&Page=0"
POST https://sync.twilio.com/v1/Services/{ServiceSid}/Streams/{Sid}
URI parameters Sid
type: string
The SID of the Stream resource to update.
Request body parameters
_11 // Download the helper library from https://www.twilio.com/docs/node/install
_11 // Find your Account SID and Auth Token at twilio.com/console
_11 // and set the environment variables. See http://twil.io/secure
_11 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11 const authToken = process.env.TWILIO_AUTH_TOKEN;
_11 const client = require('twilio')(accountSid, authToken);
_11 client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .syncStreams('TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .then(sync_stream => console.log(sync_stream.uniqueName));
_14 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "created_by": "created_by",
_14 "date_expires": "2015-07-30T21:00:00Z",
_14 "date_created": "2015-07-30T20:00:00Z",
_14 "date_updated": "2015-07-30T20:00:00Z",
_14 "messages": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams/TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages"
_14 "service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "sid": "TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "unique_name": "unique_name",
_14 "url": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams/TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
DELETE https://sync.twilio.com/v1/Services/{ServiceSid}/Streams/{Sid}
URI parameters Sid
type: string
The SID of the Stream resource to delete.
_10 // Download the helper library from https://www.twilio.com/docs/node/install
_10 // Find your Account SID and Auth Token at twilio.com/console
_10 // and set the environment variables. See http://twil.io/secure
_10 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10 const authToken = process.env.TWILIO_AUTH_TOKEN;
_10 const client = require('twilio')(accountSid, authToken);
_10 client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10 .syncStreams('TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')