メニュー

Expand
ページを評価:

ユーザーリソース

In Conversations, Users are Participants with privileges such as the ability to edit and delete Messages.

Every Conversation Participant is backed by a User. Attached to the User is:

  • the Role assigned to the User, which determines their permissions in your application
  • a JSON blob of arbitrary Attributes, which you can use to store profile information for display in your application
  • Online/Offline status, determined by whether the User is presently connected through a frontend SDK
  • the Identity string, which uniquely identifies a user in each Conversation Service.

APIのベースURL

リファレンスドキュメントの URL はすべて、次のベース URL を使用しています。

https://conversations.twilio.com/v1

Using the shortened base URL

Using the REST API, you can interact with User resources in the default Chat Service instance via a "shortened" URL that does not include the Chat Service instance SID ("ISXXX..."). If you are only using one Chat Service (the default), you do not need to include the Chat Service SID in your URL, e.g.

GET /v1/Users/

For Conversations applications that build on more than one Chat Service instance, you will need to specify the Chat Service SID in the REST API call:

GET /v1/Services/<Service SID, ISXXX...>/Users/

User properties

Resource Properties in REST API format
sid
sid<US> Not PII

The unique string that we created to identify the User resource.

account_sid
sid<AC> Not PII

The SID of the Account that created the User resource.

chat_service_sid
sid<IS> Not PII

The SID of the Conversation Service the User resource is associated with.

role_sid
sid<RL> Not PII

The SID of a service-level Role assigned to the user.

identity
文字列 PII MTL: 30 DAYS

The application-defined string that uniquely identifies the resource's User within the Conversation Service. This value is often a username or an email address, and is case-sensitive.

friendly_name
文字列 PII MTL: 30 DAYS

The string that you assigned to describe the resource.

attributes
文字列 PII MTL: 30 DAYS

The JSON Object string that stores application-specific data. If attributes have not been set, {} is returned.

is_online
boolean Not PII

Whether the User is actively connected to the Service instance and online. This value is only returned by Fetch actions that return a single resource and null is always returned by a Read action. This value is null if the Service's reachability_enabled is false, if the User has never been online for the Service instance, even if the Service's reachability_enabled is true.

date_created
date_time<iso8601> Not PII

The date and time in GMT when the resource was created specified in ISO 8601 format.

date_updated
date_time<iso8601> Not PII

The date and time in GMT when the resource was last updated specified in ISO 8601 format.

url
url Not PII

An absolute API resource URL for this user.

Create a Conversations User

post
https://conversations.twilio.com/v1/Users
パラメーター
Parameters in REST API format
identity
必須
post 文字列 PII MTL: 30 DAYS

The application-defined string that uniquely identifies the resource's User within the Conversation Service. This value is often a username or an email address, and is case-sensitive.

friendly_name
オプション
post 文字列 PII MTL: 30 DAYS

The string that you assigned to describe the resource.

attributes
オプション
post 文字列 PII MTL: 30 DAYS

The JSON Object string that stores application-specific data. If attributes have not been set, {} is returned.

role_sid
オプション
post sid<RL> Not PII

The SID of a service-level Role to assign to the user.

x_twilio_webhook_enabled
ヘッダー
post ienum:webhook_enabled_type Not PII

The X-Twilio-Webhook-Enabled HTTP request header

例 1
        
        
        
        
        Users are usually autocreated with default roles the first time the appear. To control a User's assigned Role from the moment of creation, use this resource.

        ユーザーを作成

        Users are usually autocreated with default roles the first time the appear. To control a User's assigned Role from the moment of creation, use this resource.

        Read multiple ConversationUser resources

        GET
        https://conversations.twilio.com/v1/Users
        例 1
              
              
              
              

              Update a ConversationUser resource

              post
              https://conversations.twilio.com/v1/Users/{Sid}
              パラメーター
              Parameters in REST API format
              sid
              Path
              post sid_like<US> Not PII

              The SID of the User resource to update. This value can be either the sid or the identity of the User resource to update.

              friendly_name
              オプション
              post 文字列 PII MTL: 30 DAYS

              The string that you assigned to describe the resource.

              attributes
              オプション
              post 文字列 PII MTL: 30 DAYS

              The JSON Object string that stores application-specific data. If attributes have not been set, {} is returned.

              role_sid
              オプション
              post sid<RL> Not PII

              The SID of a service-level Role to assign to the user.

              x_twilio_webhook_enabled
              ヘッダー
              post ienum:webhook_enabled_type Not PII

              The X-Twilio-Webhook-Enabled HTTP request header

              例 1
                    
                    
                    
                    
                    Example for updating the friendly_name and role_sid for a user

                    ユーザーを更新する

                    Example for updating the friendly_name and role_sid for a user

                    Delete an User resource

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

                    The SID of the User resource to delete. This value can be either the sid or the identity of the User resource to delete.

                    x_twilio_webhook_enabled
                    ヘッダー
                    削除する ienum:webhook_enabled_type Not PII

                    The X-Twilio-Webhook-Enabled HTTP request header

                    例 1
                          
                          
                          
                          
                          ページを評価:

                          ヘルプが必要ですか?

                          誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。

                                
                                
                                

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

                                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