Member Resource
A Member resource of Programmable Chat represents the membership of a User to a Channel within a Service instance.
We recommend following the standard URI specification and avoid the following reserved characters ! * ' ( ) ; : @ & = + $ , / ? % # [ ]
for values such as identity and friendly name.
Each Member resource contains these properties.
Resource properties The unique string that we created to identify the Member resource.
date_created
type: string<DATE TIME> Not PIIdate_updated
type: string<DATE TIME> Not PIIlast_consumed_message_index
type: integer Not PIIlast_consumption_timestamp
type: string<DATE TIME> Not PIIThe absolute URL of the Member resource.
The JSON string that stores application-specific data. If attributes have not been set, {}
is returned.
POST https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members
The {ChannelSid}
value can be the Channel's sid
or its unique_name
.
Request headers X-Twilio-Webhook-Enabled
type: enum<STRING> Not PII
The X-Twilio-Webhook-Enabled HTTP request header
Possible values:
true
false
URI parameters Request body parameters LastConsumedMessageIndex
type: integer Not PIILastConsumptionTimestamp
type: string<DATE TIME> Not PIIDateCreated
type: string<DATE TIME> Not PIIThe date, specified in ISO 8601(link takes you to an external page) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source.
DateUpdated
type: string<DATE TIME> Not PIIThe date, specified in ISO 8601(link takes you to an external page) format, to assign to the resource as the date it was last updated. The default value is null
. Note that this parameter should only be used when a Member is being recreated from a backup/separate source and where a Member was previously updated.
A valid JSON string that contains application-specific data.
_12 // Download the helper library from https://www.twilio.com/docs/node/install
_12 // Find your Account SID and Auth Token at twilio.com/console
_12 // and set the environment variables. See http://twil.io/secure
_12 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12 const authToken = process.env.TWILIO_AUTH_TOKEN;
_12 const client = require('twilio')(accountSid, authToken);
_12 client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .create({identity: 'identity'})
_12 .then(member => console.log(member.sid));
_14 "sid": "MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "channel_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "role_sid": "RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "last_consumed_message_index": null,
_14 "last_consumption_timestamp": null,
_14 "date_created": "2016-03-24T21:05:50Z",
_14 "date_updated": "2016-03-24T21:05:50Z",
_14 "url": "https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
GET https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}
The {ChannelSid}
value can be the Channel's sid
or its unique_name
and the {Sid}
value can be either the sid
or the identity
of the Member resource to fetch.
URI parameters Path Parameter
The SID of the Member resource to fetch. This value can be either the Member's sid
or its identity
value.
_12 // Download the helper library from https://www.twilio.com/docs/node/install
_12 // Find your Account SID and Auth Token at twilio.com/console
_12 // and set the environment variables. See http://twil.io/secure
_12 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12 const authToken = process.env.TWILIO_AUTH_TOKEN;
_12 const client = require('twilio')(accountSid, authToken);
_12 client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .members('MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .then(member => console.log(member.sid));
_14 "sid": "MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "channel_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "role_sid": "RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "last_consumed_message_index": null,
_14 "last_consumption_timestamp": null,
_14 "date_created": "2016-03-24T21:05:50Z",
_14 "date_updated": "2016-03-24T21:05:50Z",
_14 "url": "https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
GET https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members
The {ChannelSid}
value can be the Channel's sid
or its unique_name
.
URI parameters Query Parameter
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Query Parameter
The page index. This value is simply for client state.
Query Parameter
The page token. This is provided by the API.
_12 // Download the helper library from https://www.twilio.com/docs/node/install
_12 // Find your Account SID and Auth Token at twilio.com/console
_12 // and set the environment variables. See http://twil.io/secure
_12 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12 const authToken = process.env.TWILIO_AUTH_TOKEN;
_12 const client = require('twilio')(accountSid, authToken);
_12 client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .then(members => members.forEach(m => console.log(m.sid)));
_27 "first_page_url": "https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members?PageSize=50&Page=0",
_27 "previous_page_url": "https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members?PageSize=50&Page=0",
_27 "url": "https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members?PageSize=50&Page=0",
_27 "next_page_url": "https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members?PageSize=50&Page=1",
_27 "sid": "MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_27 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_27 "channel_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_27 "service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_27 "role_sid": "RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_27 "last_consumed_message_index": null,
_27 "last_consumption_timestamp": null,
_27 "date_created": "2016-03-24T21:05:50Z",
_27 "date_updated": "2016-03-24T21:05:50Z",
_27 "url": "https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
POST https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}
The {Sid}
value can be either the sid
or the identity
of the Member resource to update and the {ChannelSid}
value can be the Channel's sid
or its unique_name
.
Request headers X-Twilio-Webhook-Enabled
type: enum<STRING> Not PII
The X-Twilio-Webhook-Enabled HTTP request header
Possible values:
true
false
URI parameters Path Parameter
The SID of the Member resource to update. This value can be either the Member's sid
or its identity
value.
Request body parameters LastConsumedMessageIndex
type: integer Not PIILastConsumptionTimestamp
type: string<DATE TIME> Not PIIDateCreated
type: string<DATE TIME> Not PIIThe date, specified in ISO 8601(link takes you to an external page) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source.
DateUpdated
type: string<DATE TIME> Not PIIA valid JSON string that contains application-specific data.
_12 // Download the helper library from https://www.twilio.com/docs/node/install
_12 // Find your Account SID and Auth Token at twilio.com/console
_12 // and set the environment variables. See http://twil.io/secure
_12 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12 const authToken = process.env.TWILIO_AUTH_TOKEN;
_12 const client = require('twilio')(accountSid, authToken);
_12 client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .members('MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .update({roleSid: 'RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'})
_12 .then(member => console.log(member.sid));
_14 "sid": "MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "channel_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "role_sid": "RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "last_consumed_message_index": 20,
_14 "last_consumption_timestamp": "2016-03-24T21:05:52Z",
_14 "date_created": "2016-03-24T21:05:50Z",
_14 "date_updated": "2016-03-24T21:05:51Z",
_14 "url": "https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
DELETE https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}
The {Sid}
value can be either the sid
or the identity
of the Member resource to delete and the {ChannelSid}
value can be the Channel's sid
or its unique_name
.
Request headers X-Twilio-Webhook-Enabled
type: enum<STRING> Not PII
The X-Twilio-Webhook-Enabled HTTP request header
Possible values:
true
false
URI parameters Path Parameter
The SID of the Member resource to delete. This value can be either the Member's sid
or its identity
value.
_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.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .members('MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')