Conversation Participant Resource
Each participant in a Conversation represents one real (probably human) participant in a Conversation.
Creating a Participant joins them with the conversation, and the connected person will receive all subsequent messages.
Deleting a participant removes them from the conversation; they will receive no new messages after that point.
APIのベースURL
リファレンスドキュメントの URL はすべて、次のベース URL を使用しています。
https://conversations.twilio.com/v1
Using the shortened base URL
Using the REST API, you can interact with Conversation Participant 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/Conversations/CHxx/Participants
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/ISxx/Conversations/CHxx/Participants
ConversationParticipant properties
Resource Properties in REST API format | |
---|---|
account_sid
|
The unique ID of the Account responsible for this participant. |
conversation_sid
|
The unique ID of the Conversation for this participant. |
sid
|
このリソースを一意に識別する 34 文字の文字列です。 |
identity
|
A unique string identifier for the conversation participant as Conversation User. This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. |
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. |
messaging_binding
|
Information about how this participant exchanges messages with the conversation. A JSON parameter consisting of type and address fields of the participant. |
role_sid
|
The SID of a conversation-level Role to assign to the participant. |
date_created
|
このリソースの作成された日付です。 |
date_updated
|
このリソースが最後に更新された日付です。 |
url
|
An absolute API resource URL for this participant. |
last_read_message_index
|
Index of last “read” message in the Conversation for the Participant. |
last_read_timestamp
|
Timestamp of last “read” message in the Conversation for the Participant. |
Add a Conversation Participant (SMS)
https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Participants
Adding a new participant to an ongoing conversation immediately allows them to see all subsequent communications. The same person (i.e., a single personal phone number) can be part of any number of conversations concurrently, as long as the address they are in contact with (the ProxyAddress
) is unique.
To create a Conversation Participant by SMS, you must enter:
- Their phone number as the
messagingbinding.address
- Your Twilio number as the
messagingbinding.proxyaddress
.
To create a Conversation Participant by Chat, you must enter the Chat User Identity as the identity
parameter.
We recommend following the standard URI specification and avoid the following reserved characters ! * ' ( ) ; : @ & = + $ , / ? % # [ ]
for values such as identity and friendly name.
パラメーター
Parameters in REST API format | |
---|---|
conversation_sid
Path
|
The unique ID of the Conversation for this participant. |
identity
オプション
|
A unique string identifier for the conversation participant as Conversation User. This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. |
messaging_binding.address
オプション
|
The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with proxy_address) is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). |
messaging_binding.proxy_address
オプション
|
The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). |
date_created
オプション
|
このリソースの作成された日付です。 |
date_updated
オプション
|
このリソースが最後に更新された日付です。 |
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. |
messaging_binding.projected_address
オプション
|
The address of the Twilio phone number that is used in Group MMS. Communication mask for the Conversation participant with Identity. |
role_sid
オプション
|
The SID of a conversation-level Role to assign to the participant. |
x_twilio_webhook_enabled
ヘッダー
|
The X-Twilio-Webhook-Enabled HTTP request header |
例 1
例 2
Fetch a ConversationParticipant resource
https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Participants/{Sid}
パラメーター
Parameters in REST API format | |
---|---|
conversation_sid
Path
|
The unique ID of the Conversation for this participant. |
sid
Path
|
このリソースを一意に識別する 34 文字の文字列です。 |
例 1
Read multiple ConversationParticipant resources
https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Participants
パラメーター
Parameters in REST API format | |
---|---|
conversation_sid
Path
|
The unique ID of the Conversation for participants. |
例 1
Update a ConversationParticipant resource
https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Participants/{Sid}
パラメーター
Parameters in REST API format | |
---|---|
conversation_sid
Path
|
The unique ID of the Conversation for this participant. |
sid
Path
|
このリソースを一意に識別する 34 文字の文字列です。 |
date_created
オプション
|
このリソースの作成された日付です。 |
date_updated
オプション
|
このリソースが最後に更新された日付です。 |
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. |
role_sid
オプション
|
The SID of a conversation-level Role to assign to the participant. |
messaging_binding.proxy_address
オプション
|
The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. |
messaging_binding.projected_address
オプション
|
The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. |
identity
オプション
|
A unique string identifier for the conversation participant as Conversation User. This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. |
last_read_message_index
オプション
|
Index of last “read” message in the Conversation for the Participant. |
last_read_timestamp
オプション
|
Timestamp of last “read” message in the Conversation for the Participant. |
x_twilio_webhook_enabled
ヘッダー
|
The X-Twilio-Webhook-Enabled HTTP request header |
例 1
例 2
Delete a ConversationParticipant resource
https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Participants/{Sid}
パラメーター
Parameters in REST API format | |
---|---|
conversation_sid
Path
|
The unique ID of the Conversation for this participant. |
sid
Path
|
このリソースを一意に識別する 34 文字の文字列です。 |
x_twilio_webhook_enabled
ヘッダー
|
The X-Twilio-Webhook-Enabled HTTP request header |
例 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 Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.