メニュー

Expand
ページを評価:

User Conversation Resource

The UserConversation resource lists the Conversations in which a particular User is an active Participant. Use this resource to:

  • list a user's conversations, present or historical,
  • mute a user’s push notifications for specific channels, or
  • count a user’s unread messages.

UserConversation properties

Each UserConversation resource contains these properties.

Resource Properties in REST API format
account_sid
sid<AC> Not PII

The unique ID of the Account responsible for this conversation.

chat_service_sid
sid<IS> Not PII

The unique ID of the Conversation Service this conversation belongs to.

conversation_sid
sid<CH> Not PII

The unique ID of the Conversation for this User Conversation.

unread_messages_count
integer? Not PII

The number of unread Messages in the Conversation for the Participant.

last_read_message_index
integer? Not PII

The index of the last Message in the Conversation that the Participant has read.

participant_sid
sid<MB> Not PII

The unique ID of the participant the user conversation belongs to.

user_sid
sid<US> Not PII

The unique string that identifies the User resource.

friendly_name
文字列 PII MTL: 30 DAYS

The human-readable name of this conversation, limited to 256 characters. Optional.

conversation_state
enum:state Not PII

The current state of this User Conversation. One of inactive, active or closed.

timers
オブジェクト Not PII

Timer date values representing state update for this conversation.

attributes
文字列 PII MTL: 30 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.

date_created
date_time<iso8601> Not PII

The date that this conversation was created, given in ISO 8601 format.

date_updated
date_time<iso8601> Not PII

The date that this conversation was last updated, given in ISO 8601 format.

created_by
文字列 Not PII

Identity of the creator of this Conversation.

notification_level
enum:notification_level Not PII

The Notification Level of this User Conversation. One of default or muted.

unique_name
文字列 PII MTL: 30 DAYS

An application-defined string that uniquely identifies the Conversation resource. It can be used to address the resource in place of the resource's conversation_sid in the URL.

url
url Not PII

links
uri_map Not PII

Contains absolute URLs to access the participant and conversation of this conversation.

Fetch a specific conversation

GET
https://conversations.twilio.com/v1/Users/{UserSid}/Conversations/{ConversationSid}

The {UserSid} value can be either the sid or the identity of the User resource and the {ConversationSid} value can be either the sid or the unique_name of the Conversation to fetch.

パラメーター
Parameters in REST API format
user_sid
Path
GET sid_like<US> Not PII

The unique SID identifier of the User resource. This value can be either the sid or the identity of the User resource.

conversation_sid
Path
GET sid_like<CH> Not PII

The unique SID identifier of the Conversation. This value can be either the sid or the unique_name of the Conversation resource.

例 1
        
        
        

        List All of a User's Conversations

        GET
        https://conversations.twilio.com/v1/Users/{UserSid}/Conversations

        The {UserSid} value can be either the sid or the identity of the User resource to read UserConversation resources from.

        パラメーター
        Parameters in REST API format
        user_sid
        Path
        GET sid_like<US> Not PII

        The unique SID identifier of the User resource. This value can be either the sid or the identity of the User resource.

        例 1
              
              
              

              Set the NotificationLevel for a conversation

              post
              https://conversations.twilio.com/v1/Users/{UserSid}/Conversations/{ConversationSid}

              The NotificationLevel property expresses whether a user receives pushes for this conversation or not. This can be set separately for each user/conversation pair.

              パラメーター
              Parameters in REST API format
              user_sid
              Path
              post sid_like<US> Not PII

              The unique SID identifier of the User resource. This value can be either the sid or the identity of the User resource.

              conversation_sid
              Path
              post sid_like<CH> Not PII

              The unique SID identifier of the Conversation. This value can be either the sid or the unique_name of the Conversation resource.

              notification_level
              オプション
              post ienum:notification_level Not PII

              The Notification Level of this User Conversation. One of default or muted.

              last_read_timestamp
              オプション
              post date_time<iso8601> Not PII

              The date of the last message read in conversation by the user, given in ISO 8601 format.

              last_read_message_index
              オプション
              post integer? Not PII

              The index of the last Message in the Conversation that the Participant has read.

              例 1
                    
                    
                    

                    Remove a User from one of their Conversations

                    削除する
                    https://conversations.twilio.com/v1/Users/{UserSid}/Conversations/{ConversationSid}
                    パラメーター
                    Parameters in REST API format
                    user_sid
                    Path
                    削除する sid_like<US> Not PII

                    The unique SID identifier of the User resource. This value can be either the sid or the identity of the User resource.

                    conversation_sid
                    Path
                    削除する sid_like<CH> Not PII

                    The unique SID identifier of the Conversation. This value can be either the sid or the unique_name of the Conversation resource.

                    例 1
                          
                          
                          
                          ページを評価:

                          ヘルプが必要ですか?

                          We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Community Forums or browsing the Twilio tag on Stack Overflow.

                                
                                
                                

                                フィードバックくださりありがとうございます!

                                We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

                                Sending your feedback...
                                🎉 Thank you for your feedback!
                                Something went wrong. Please try again.

                                Thanks for your feedback!

                                Refer us and get $10 in 3 simple steps!

                                ステップ1

                                Get link

                                Get a free personal referral link here

                                ステップ2:

                                Give $10

                                Your user signs up and upgrade using link

                                ステップ3

                                Get $10

                                1,250 free SMSes
                                OR 1,000 free voice mins
                                OR 12,000 chats
                                OR more