Menu

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?

Members Resource

The Member resource of Programmable Chat represents the membership of a User within the Service instance to a Channel.

Properties

Each member has these properties:

Names in PHP format
sid
sid<MB> Not PII

A 34 character string that uniquely identifies this resource.

accountSid
sid<AC> Not PII

The unique id of the Account responsible for this member.

channelSid
sid<CH> Not PII

The unique id of the Channel for this member.

serviceSid
sid<IS> Not PII

The unique id of the Service this member belongs to.

identity

A unique string identifier for this User in this Service. See the access tokens docs for more details.

dateCreated
date_time<iso8601> Not PII

The date that this resource was created.

dateUpdated
date_time<iso8601> Not PII

The date that this resource was last updated.

roleSid
sid<RL> Not PII

The Role assigned to this member.

lastConsumedMessageIndex
integer? Not PII

An Integer representing index of the last Message this Member has read within this Channel

lastConsumptionTimestamp
date_time<iso8601> Not PII

An ISO8601 based timestamp string representing the datetime of the last Message read event for this Member within this Channel

url
url Not PII

An absolute URL for this member.

attributes

An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. Note that if the attributes are not set "{}" will be returned.

List All Members of a Channel

GET /Services/{Service SID}/Channels/{Channel SID}/Members
Names in PHP format
serviceSid
Required
get sid<IS> Not PII

Sid of the Service this member belongs to.

channelSid
Required
get sid_like<CH> Not PII

Key of the Channel this member belongs to. Could be Sid or UniqueName

identity
Optional
get string[] PII MTL: 120 DAYS

A unique string identifier for this User in this Service. See the access tokens docs for more details.

        
        
        
        

        Add a Member to a Channel

        POST /Services/{Service SID}/Channels/{Channel SID}/Members
        

        Parameters

        Names in PHP format
        serviceSid
        Required
        post sid<IS> Not PII

        Sid of the Service this member belongs to.

        channelSid
        Required
        post sid_like<CH> Not PII

        Key of the Channel this member belongs to. Could be Sid or UniqueName

        identity
        Required
        post string PII MTL: 120 DAYS

        A unique string identifier for this User in this Service. See the access tokens docs for more details.

        roleSid
        Optional
        post sid<RL> Not PII

        The role to be assigned to this member. Defaults to the roles specified on the Service.

        lastConsumedMessageIndex
        Optional
        post integer? Not PII

        Field used to specify the last consumed Message index for the Channel for this Member. Should only be used when recreating a Member from a backup/separate source.

        lastConsumptionTimestamp
        Optional
        post date_time<iso8601> Not PII

        ISO8601 time indicating the last datetime the Member consumed a Message in the Channel. Should only be used when recreating a Member from a backup/separate source

        dateCreated
        Optional
        post date_time<iso8601> Not PII

        The ISO8601 time specifying the datetime the Members should be set as being created. Will be set to the current time by the Chat service if not specified. Note that this should only be used in cases where a Member is being recreated from a backup/separate source

        dateUpdated
        Optional
        post date_time<iso8601> Not PII

        The ISO8601 time specifying the datetime the Member should be set as having been last updated. Will be set to the null by the Chat service if not specified. Note that this should only be used in cases where a Member is being recreated from a backup/separate source and where a Member was previously updated.

        attributes
        Optional
        post string PII MTL: 120 DAYS

        An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. Note that if the attributes are not set "{}" will be returned.

              
              
              
              

              Update an existing Member

              You are able to update an existing Member via the SID or Identity

              Member SID

              POST /Services/{Service SID}/Channels/{Channel SID}/Members/{Member SID}
              

              Member Identity

              POST /Services/{Service SID}/Channels/{Channel SID}/Members/{Member Identity}
              

              Parameters

              Names in PHP format
              serviceSid
              Required
              post sid<IS> Not PII

              Sid of the Service this member belongs to.

              channelSid
              Required
              post sid_like<CH> Not PII

              Key of the Channel this member belongs to. Could be Sid or UniqueName

              sid
              Required
              post sid_like<MB> Not PII

              Key that uniquely defines the member to update. Could be Member Sid or User Identity.

              roleSid
              Optional
              post sid<RL> Not PII

              The role to be assigned to this member. Defaults to the roles specified on the Service.

              lastConsumedMessageIndex
              Optional
              post integer? Not PII

              Field used to specify the last consumed Message index for the Channel for this Member. Should only be used when recreating a Member from a backup/separate source.

              lastConsumptionTimestamp
              Optional
              post date_time<iso8601> Not PII

              ISO8601 time indicating the last datetime the Member consumed a Message in the Channel. Should only be used when recreating a Member from a backup/separate source

              dateCreated
              Optional
              post date_time<iso8601> Not PII

              The ISO8601 time specifying the datetime the Members should be set as being created. Will be set to the current time by the Chat service if not specified. Note that this should only be used in cases where a Member is being recreated from a backup/separate source

              dateUpdated
              Optional
              post date_time<iso8601> Not PII

              The ISO8601 time specifying the datetime the Member should be set as having been last updated. Will be set to the null by the Chat service if not specified. Note that this should only be used in cases where a Member is being recreated from a backup/separate source and where a Member was previously updated.

              attributes
              Optional
              post string PII MTL: 120 DAYS

              An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. Note that if the attributes are not set "{}" will be returned.

              Retrieve a Member of a Channel

              You are able to retrieve an existing Member via the SID or Identity

              Member SID

              GET /Services/{Service SID}/Channels/{Channel SID}/Members/{Member SID}
              

              Member Identity

              GET /Services/{Service SID}/Channels/{Channel SID}/Members/{Member Identity}
              
                    
                    
                    
                    

                    Remove a Member from a Channel

                    You are able to remove an existing Member via the SID or Identity

                    Member SID

                    DELETE /Services/{Service SID}/Channels/{Channel SID}/Members/{Member SID}
                    

                    Member Identity

                    DELETE /Services/{Service SID}/Channels/{Channel SID}/Members/{Member Identity}
                    
                          
                          
                          
                          

                          Need some help?

                          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.