ユーザーリソース
In Conversations, Users are Participants with privileges such as the ability to edit and delete Messages.
Every Conversation Participant who connects with a Chat SDK (browser or mobile) is backed by a User. Participants over SMS or other non-chat channel, in contrast, do not have a corresponding 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 Conversation Service instance via a "shortened" URL that does not include the Conversation Service instance SID ("ISXXX..."). If you are only using one Conversation Service (the default), you do not need to include the Conversation Service SID in your URL, e.g.
GET /v1/Users/
For Conversations applications that build on more than one Conversation Service instance, you will need to specify the Conversation Service SID in the REST API call:
GET /v1/Services/<Service SID, ISXXX...>/Users/
User properties
Resource Properties in REST API format | |
---|---|
sid
|
The unique string that we created to identify the User resource. |
account_sid
|
The SID of the Account that created the User resource. |
chat_service_sid
|
The SID of the Conversation Service the User resource is associated with. |
role_sid
|
The SID of a service-level Role assigned to the user. |
identity
|
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
|
The string that you assigned to describe the resource. |
attributes
|
The JSON Object string that stores application-specific data. If attributes have not been set, |
is_online
|
Whether the User is actively connected to this Conversations Service and online. This value is only returned by Fetch actions that return a single resource and |
is_notifiable
|
Whether the User has a potentially valid Push Notification registration (APN or GCM) for this Conversations Service. If at least one registration exists, |
date_created
|
The date and time in GMT when the resource was created specified in ISO 8601 format. |
date_updated
|
The date and time in GMT when the resource was last updated specified in ISO 8601 format. |
url
|
An absolute API resource URL for this user. |
Create a Conversations User
https://conversations.twilio.com/v1/Users
パラメーター
Parameters in REST API format | |
---|---|
identity
必須
|
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
オプション
|
The string that you assigned to describe the resource. |
attributes
オプション
|
The JSON Object string that stores application-specific data. If attributes have not been set, |
role_sid
オプション
|
The SID of a service-level Role to assign to the user. |
x_twilio_webhook_enabled
ヘッダー
|
The X-Twilio-Webhook-Enabled HTTP request header |
例 1
Read multiple ConversationUser resources
https://conversations.twilio.com/v1/Users
例 1
Update a ConversationUser resource
https://conversations.twilio.com/v1/Users/{Sid}
パラメーター
Parameters in REST API format | |
---|---|
sid
Path
|
The SID of the User resource to update. This value can be either the |
friendly_name
オプション
|
The string that you assigned to describe the resource. |
attributes
オプション
|
The JSON Object string that stores application-specific data. If attributes have not been set, |
role_sid
オプション
|
The SID of a service-level Role to assign to the user. |
x_twilio_webhook_enabled
ヘッダー
|
The X-Twilio-Webhook-Enabled HTTP request header |
例 1
Delete an User resource
https://conversations.twilio.com/v1/Users/{Sid}
パラメーター
Parameters in REST API format | |
---|---|
sid
Path
|
The SID of the User resource to delete. This value can be either the |
x_twilio_webhook_enabled
ヘッダー
|
The X-Twilio-Webhook-Enabled HTTP request header |
例 1
ヘルプが必要ですか?
誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。