chat
Creates, updates, deletes, gets or lists a chat resource.
Overview
| Name | chat |
| Type | Resource |
| Id | azure.communication_chat.chat |
Fields
The following fields are returned by SELECT queries:
- list_chat_threads
| Name | Datatype | Description |
|---|---|---|
id | string | Chat thread id. Required. |
deletedOn | string (date-time) | The timestamp when the chat thread was deleted. The timestamp is in RFC3339 format: yyyy-MM-ddTHH:mm:ssZ. |
lastMessageReceivedOn | string (date-time) | The timestamp when the last message arrived at the server. The timestamp is in RFC3339 format: yyyy-MM-ddTHH:mm:ssZ. |
topic | string | Chat thread topic. Required. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_chat_threads | select | endpoint | maxPageSize, startTime | Gets the list of chat threads of a user. Gets the list of chat threads of a user. |
create_chat_thread | insert | endpoint, topic | repeatability-request-id | Creates a chat thread. Creates a chat thread. |
delete_chat_thread | delete | chat_thread_id, endpoint | Deletes a thread. Deletes a thread. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
chat_thread_id | string | Id of the thread to be deleted. Required. |
endpoint | string | The service endpoint host (no scheme). (default: ) |
maxPageSize | integer | The maximum number of chat threads returned per page. Default value is None. |
repeatability-request-id | string | If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs. Default value is None. |
startTime | string (date-time) | The earliest point in time to get chat threads up to. The timestamp should be in RFC3339 format: yyyy-MM-ddTHH:mm:ssZ. Default value is None. |
SELECT examples
- list_chat_threads
Gets the list of chat threads of a user. Gets the list of chat threads of a user.
SELECT
id,
deletedOn,
lastMessageReceivedOn,
topic
FROM azure.communication_chat.chat
WHERE endpoint = '{{ endpoint }}' -- required
AND maxPageSize = '{{ maxPageSize }}'
AND startTime = '{{ startTime }}'
;
INSERT examples
- create_chat_thread
- Manifest
Creates a chat thread. Creates a chat thread.
INSERT INTO azure.communication_chat.chat (
topic,
participants,
endpoint,
repeatability-request-id
)
SELECT
'{{ topic }}' /* required */,
'{{ participants }}',
'{{ endpoint }}',
'{{ repeatability-request-id }}'
RETURNING
chatThread,
invalidParticipants
;
# Description fields are for documentation purposes
- name: chat
props:
- name: endpoint
value: "{{ endpoint }}"
description: Required parameter for the chat resource.
- name: topic
value: "{{ topic }}"
description: |
The chat thread topic. Required.
- name: participants
description: |
Participants to be added to the chat thread.
value:
- communicationIdentifier:
kind: "{{ kind }}"
rawId: "{{ rawId }}"
communicationUser:
id: "{{ id }}"
phoneNumber:
value: "{{ value }}"
microsoftTeamsUser:
userId: "{{ userId }}"
isAnonymous: {{ isAnonymous }}
cloud: "{{ cloud }}"
microsoftTeamsApp:
appId: "{{ appId }}"
cloud: "{{ cloud }}"
displayName: "{{ displayName }}"
shareHistoryTime: "{{ shareHistoryTime }}"
- name: repeatability-request-id
value: "{{ repeatability-request-id }}"
description: If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs. Default value is None.
description: If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs. Default value is None.
DELETE examples
- delete_chat_thread
Deletes a thread. Deletes a thread.
DELETE FROM azure.communication_chat.chat
WHERE chat_thread_id = '{{ chat_thread_id }}' --required
AND endpoint = '{{ endpoint }}' --required
;