From 1b9f8095b428546526a2679fd21da333006fd8e0 Mon Sep 17 00:00:00 2001 From: "Amr Elroumy (Work)" <77645021+amrelroumy-msft@users.noreply.github.com> Date: Fri, 16 Apr 2021 15:05:58 -0700 Subject: [PATCH] Adding support for message properties in ACS Chat (#13939) * Initial commit (copying over stable API version) * Making changes to support message metadata --- .../communicationserviceschat.json | 1711 +++++++++++++++++ ...ions_ListChatReadReceiptsWithPageSize.json | 69 + .../Conversations_SendChatReadReceipt.json | 45 + .../examples/Messages_DeleteChatMessage.json | 43 + .../examples/Messages_GetChatMessage.json | 61 + ...Messages_ListChatMessagesWithPageSize.json | 157 ++ .../examples/Messages_SendChatMessage.json | 53 + .../Messages_SendTypingNotification.json | 42 + .../examples/Messages_UpdateChatMessage.json | 47 + .../Participants_AddChatParticipants.json | 91 + ...ants_ListChatParticipantsWithPageSize.json | 69 + .../Participants_RemoveChatParticipant.json | 48 + .../examples/Threads_CreateChatThread.json | 111 ++ ..._CreateChatThreadWithIdempotencyToken.json | 112 ++ .../examples/Threads_DeleteChatThread.json | 42 + .../examples/Threads_GetChatThread.json | 54 + .../Threads_ListChatThreadsWithPageSize.json | 74 + .../Threads_UpdateChatThreadTopic.json | 46 + .../readme.md | 11 + 19 files changed, 2886 insertions(+) create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/communicationserviceschat.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Conversations_ListChatReadReceiptsWithPageSize.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Conversations_SendChatReadReceipt.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_DeleteChatMessage.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_GetChatMessage.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_ListChatMessagesWithPageSize.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_SendChatMessage.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_SendTypingNotification.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_UpdateChatMessage.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Participants_AddChatParticipants.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Participants_ListChatParticipantsWithPageSize.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Participants_RemoveChatParticipant.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_CreateChatThread.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_CreateChatThreadWithIdempotencyToken.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_DeleteChatThread.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_GetChatThread.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_ListChatThreadsWithPageSize.json create mode 100644 specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_UpdateChatThreadTopic.json diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/communicationserviceschat.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/communicationserviceschat.json new file mode 100644 index 000000000000..42c503ccf6f8 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/communicationserviceschat.json @@ -0,0 +1,1711 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Communication Chat Service", + "description": "Azure Communication Chat Service", + "version": "2021-04-05-preview6" + }, + "paths": { + "/chat/threads/{chatThreadId}/readReceipts": { + "get": { + "tags": [ + "Threads" + ], + "summary": "Gets chat message read receipts for a thread.", + "operationId": "ChatThread_ListChatReadReceipts", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "Thread id to get the chat message read receipts for.", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "maxPageSize", + "description": "The maximum number of chat message read receipts to be returned per page.", + "type": "integer", + "format": "int32" + }, + { + "in": "query", + "name": "skip", + "description": "Skips chat message read receipts up to a specified position in response.", + "type": "integer", + "format": "int32" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Request successful. The action returns the requested `ChatMessageReadReceipt` resources.", + "schema": { + "$ref": "#/definitions/ChatMessageReadReceiptsCollection" + } + }, + "401": { + "description": "Unauthorized.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Get thread read receipts with pagination (max page size)": { + "$ref": "./examples/Conversations_ListChatReadReceiptsWithPageSize.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "value" + } + }, + "post": { + "tags": [ + "Threads" + ], + "summary": "Sends a read receipt event to a thread, on behalf of a user.", + "operationId": "ChatThread_SendChatReadReceipt", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "Thread id to send the read receipt event to.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "sendReadReceiptRequest", + "description": "Read receipt details.", + "required": true, + "schema": { + "$ref": "#/definitions/SendReadReceiptRequest" + } + } + ], + "responses": { + "200": { + "description": "Request successful." + }, + "401": { + "description": "Unauthorized.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Send read receipt": { + "$ref": "./examples/Conversations_SendChatReadReceipt.json" + } + } + } + }, + "/chat/threads/{chatThreadId}/messages": { + "post": { + "tags": [ + "Messages" + ], + "summary": "Sends a message to a thread.", + "operationId": "ChatThread_SendChatMessage", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "The thread id to send the message to.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "sendChatMessageRequest", + "description": "Details of the message to send.", + "required": true, + "schema": { + "$ref": "#/definitions/SendChatMessageRequest" + } + } + ], + "responses": { + "201": { + "description": "Message sent, the `Location` header contains the URL for the newly sent message.", + "schema": { + "$ref": "#/definitions/SendChatMessageResult" + } + }, + "401": { + "description": "Unauthorized.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Send Message": { + "$ref": "./examples/Messages_SendChatMessage.json" + } + } + }, + "get": { + "tags": [ + "Messages" + ], + "summary": "Gets a list of messages from a thread.", + "operationId": "ChatThread_ListChatMessages", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "The thread id of the message.", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "maxPageSize", + "description": "The maximum number of messages to be returned per page.", + "type": "integer", + "format": "int32" + }, + { + "in": "query", + "name": "startTime", + "description": "The earliest point in time to get messages up to. The timestamp should be in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "format": "date-time" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ChatMessagesCollection" + } + }, + "401": { + "description": "Unauthorized.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Get messages with pagination (max page size)": { + "$ref": "./examples/Messages_ListChatMessagesWithPageSize.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "value" + } + } + }, + "/chat/threads/{chatThreadId}/messages/{chatMessageId}": { + "get": { + "tags": [ + "Messages" + ], + "summary": "Gets a message by id.", + "operationId": "ChatThread_GetChatMessage", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "The thread id to which the message was sent.", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "chatMessageId", + "description": "The message id.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Request successful. The action returns a `Message` resource.", + "schema": { + "$ref": "#/definitions/ChatMessage" + } + }, + "401": { + "description": "Unauthorized.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Get Message": { + "$ref": "./examples/Messages_GetChatMessage.json" + } + } + }, + "patch": { + "tags": [ + "Messages" + ], + "summary": "Updates a message.", + "operationId": "ChatThread_UpdateChatMessage", + "consumes": [ + "application/merge-patch+json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "The thread id to which the message was sent.", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "chatMessageId", + "description": "The message id.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "updateChatMessageRequest", + "description": "Details of the request to update the message.", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateChatMessageRequest" + } + } + ], + "responses": { + "204": { + "description": "Message is successfully updated." + }, + "401": { + "description": "Unauthorized.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Update message content": { + "$ref": "./examples/Messages_UpdateChatMessage.json" + } + } + }, + "delete": { + "tags": [ + "Messages" + ], + "summary": "Deletes a message.", + "operationId": "ChatThread_DeleteChatMessage", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "The thread id to which the message was sent.", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "chatMessageId", + "description": "The message id.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "204": { + "description": "Request successful." + }, + "401": { + "description": "Unauthorized.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Delete message": { + "$ref": "./examples/Messages_DeleteChatMessage.json" + } + } + } + }, + "/chat/threads/{chatThreadId}/typing": { + "post": { + "tags": [ + "Messages" + ], + "summary": "Posts a typing event to a thread, on behalf of a user.", + "operationId": "ChatThread_SendTypingNotification", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "Id of the thread.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Request successful." + }, + "401": { + "description": "Unauthorized.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Post typing event to a thread": { + "$ref": "./examples/Messages_SendTypingNotification.json" + } + } + } + }, + "/chat/threads/{chatThreadId}/participants": { + "get": { + "tags": [ + "Participants" + ], + "summary": "Gets the participants of a thread.", + "operationId": "ChatThread_ListChatParticipants", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "Thread id to get participants for.", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "maxPageSize", + "description": "The maximum number of participants to be returned per page.", + "type": "integer", + "format": "int32" + }, + { + "in": "query", + "name": "skip", + "description": "Skips participants up to a specified position in response.", + "type": "integer", + "format": "int32" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Request successful. The action returns the participants of a thread.", + "schema": { + "$ref": "#/definitions/ChatParticipantsCollection" + } + }, + "401": { + "description": "Unauthorized.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Get participants with pagination (max page size)": { + "$ref": "./examples/Participants_ListChatParticipantsWithPageSize.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "value" + } + } + }, + "/chat/threads/{chatThreadId}/participants/:remove": { + "post": { + "tags": [ + "Participants" + ], + "summary": "Remove a participant from a thread.", + "operationId": "ChatThread_RemoveChatParticipant", + "consumes": [ + "application/json", + "application/merge-patch+json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "Thread id to remove the participant from.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "participantCommunicationIdentifier", + "description": "Id of the thread participant to remove from the thread.", + "required": true, + "schema": { + "$ref": "#/definitions/CommunicationIdentifierModel" + } + } + ], + "responses": { + "204": { + "description": "Request successful." + }, + "401": { + "description": "Unauthorized.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Remove participant": { + "$ref": "./examples/Participants_RemoveChatParticipant.json" + } + } + } + }, + "/chat/threads/{chatThreadId}/participants/:add": { + "post": { + "tags": [ + "Participants" + ], + "summary": "Adds thread participants to a thread. If participants already exist, no change occurs.", + "operationId": "ChatThread_AddChatParticipants", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "Id of the thread to add participants to.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "addChatParticipantsRequest", + "description": "Thread participants to be added to the thread.", + "required": true, + "schema": { + "$ref": "#/definitions/AddChatParticipantsRequest" + } + } + ], + "responses": { + "201": { + "description": "The participants were successfully added.", + "schema": { + "$ref": "#/definitions/AddChatParticipantsResult" + } + }, + "401": { + "description": "Unauthorized.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Add participants": { + "$ref": "./examples/Participants_AddChatParticipants.json" + } + } + } + }, + "/chat/threads": { + "post": { + "tags": [ + "Threads" + ], + "summary": "Creates a chat thread.", + "operationId": "Chat_CreateChatThread", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "header", + "name": "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.", + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "createChatThreadRequest", + "description": "Request payload for creating a chat thread.", + "required": true, + "schema": { + "$ref": "#/definitions/CreateChatThreadRequest" + } + } + ], + "responses": { + "201": { + "description": "Thread created, the `Location` header would contain the URL for the newly created thread.", + "schema": { + "$ref": "#/definitions/CreateChatThreadResult" + } + }, + "401": { + "description": "Unauthorized.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Create chat thread": { + "$ref": "./examples/Threads_CreateChatThread.json" + }, + "Create chat thread with repeatability request id header": { + "$ref": "./examples/Threads_CreateChatThreadWithIdempotencyToken.json" + } + } + }, + "get": { + "tags": [ + "Threads" + ], + "summary": "Gets the list of chat threads of a user.", + "operationId": "Chat_ListChatThreads", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "query", + "name": "maxPageSize", + "description": "The maximum number of chat threads returned per page.", + "type": "integer", + "format": "int32" + }, + { + "in": "query", + "name": "startTime", + "description": "The earliest point in time to get chat threads up to. The timestamp should be in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "format": "date-time" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Request successful. The action returns a `GetThreadsResponse` resource.", + "schema": { + "$ref": "#/definitions/ChatThreadsItemCollection" + } + }, + "401": { + "description": "Unauthorized.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Get threads with pagination (Max Page Size)": { + "$ref": "./examples/Threads_ListChatThreadsWithPageSize.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "value" + } + } + }, + "/chat/threads/{chatThreadId}": { + "patch": { + "tags": [ + "Threads" + ], + "summary": "Updates a thread's properties.", + "operationId": "ChatThread_UpdateChatThreadProperties", + "consumes": [ + "application/merge-patch+json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "The id of the thread to update.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "updateChatThreadRequest", + "description": "Request payload for updating a chat thread.", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateChatThreadRequest" + } + } + ], + "responses": { + "204": { + "description": "Thread was successfully updated." + }, + "401": { + "description": "Unauthorized.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Update chat thread topic": { + "$ref": "./examples/Threads_UpdateChatThreadTopic.json" + } + } + }, + "get": { + "tags": [ + "Threads" + ], + "summary": "Gets a chat thread's properties.", + "operationId": "ChatThread_GetChatThreadProperties", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "Id of the thread.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Request successful. The action returns a chat thread.", + "schema": { + "$ref": "#/definitions/ChatThreadProperties" + } + }, + "401": { + "description": "Unauthorized.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Get chat thread": { + "$ref": "./examples/Threads_GetChatThread.json" + } + } + }, + "delete": { + "tags": [ + "Threads" + ], + "summary": "Deletes a thread.", + "operationId": "Chat_DeleteChatThread", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "chatThreadId", + "description": "Id of the thread to be deleted.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "204": { + "description": "Request successful." + }, + "401": { + "description": "Unauthorized.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "403": { + "description": "Forbidden.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "429": { + "description": "Too many requests.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + }, + "503": { + "description": "Service unavailable.", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Delete chat thread": { + "$ref": "./examples/Threads_DeleteChatThread.json" + } + } + } + } + }, + "definitions": { + "CommunicationUserIdentifierModel": { + "$ref": "../../../Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#/definitions/CommunicationUserIdentifierModel" + }, + "CommunicationCloudEnvironment": { + "$ref": "../../../Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#/definitions/CommunicationCloudEnvironmentModel" + }, + "MicrosoftTeamsUserIdentifierModel": { + "$ref": "../../../Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#/definitions/MicrosoftTeamsUserIdentifierModel" + }, + "CommunicationIdentifierModel": { + "$ref": "../../../Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#/definitions/CommunicationIdentifierModel" + }, + "ChatMessageReadReceipt": { + "description": "A chat message read receipt indicates the time a chat message was read by a recipient.", + "required": [ + "chatMessageId", + "readOn", + "senderCommunicationIdentifier" + ], + "type": "object", + "properties": { + "senderCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel" + }, + "chatMessageId": { + "description": "Id of the chat message that has been read. This id is generated by the server.", + "type": "string", + "example": "1591137790240" + }, + "readOn": { + "format": "date-time", + "description": "The time at which the message was read. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "example": "2020-10-30T10:50:50Z" + } + } + }, + "ChatMessageReadReceiptsCollection": { + "description": "A paged collection of chat message read receipts.", + "required": [ + "value" + ], + "type": "object", + "properties": { + "value": { + "description": "Collection of chat message read receipts.", + "type": "array", + "items": { + "$ref": "#/definitions/ChatMessageReadReceipt" + } + }, + "nextLink": { + "description": "If there are more chat message read receipts that can be retrieved, the next link will be populated.", + "type": "string", + "readOnly": true + } + } + }, + "CommunicationError": { + "$ref": "../../../Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#/definitions/CommunicationError" + }, + "CommunicationErrorResponse": { + "$ref": "../../../Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#/definitions/CommunicationErrorResponse" + }, + "SendReadReceiptRequest": { + "description": "Request payload for sending a read receipt.", + "required": [ + "chatMessageId" + ], + "type": "object", + "properties": { + "chatMessageId": { + "description": "Id of the latest chat message read by the user.", + "type": "string", + "example": "1592435762364" + } + } + }, + "ChatMessageType": { + "description": "The chat message type.", + "enum": [ + "text", + "html", + "topicUpdated", + "participantAdded", + "participantRemoved" + ], + "type": "string", + "x-ms-enum": { + "name": "ChatMessageType", + "modelAsString": true + } + }, + "SendChatMessageRequest": { + "description": "Details of the message to send.", + "required": [ + "content" + ], + "type": "object", + "properties": { + "content": { + "description": "Chat message content.", + "type": "string", + "example": "Come one guys, lets go for lunch together." + }, + "senderDisplayName": { + "description": "The display name of the chat message sender. This property is used to populate sender name for push notifications.", + "type": "string", + "example": "Bob Admin" + }, + "type": { + "$ref": "#/definitions/ChatMessageType" + }, + "properties": { + "description": "Message properties", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "SendChatMessageResult": { + "description": "Result of the send message operation.", + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "description": "A server-generated message id.", + "type": "string", + "example": "123456789" + } + } + }, + "ChatParticipant": { + "description": "A participant of the chat thread.", + "required": [ + "communicationIdentifier" + ], + "type": "object", + "properties": { + "communicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel" + }, + "displayName": { + "description": "Display name for the chat participant.", + "type": "string", + "example": "Bob" + }, + "shareHistoryTime": { + "format": "date-time", + "description": "Time from which the chat history is shared with the participant. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "example": "2020-10-30T10:50:50Z" + } + } + }, + "ChatMessageContent": { + "description": "Content of a chat message.", + "type": "object", + "properties": { + "message": { + "description": "Chat message content for messages of types text or html.", + "type": "string", + "example": "Come one guys, lets go for lunch together." + }, + "topic": { + "description": "Chat message content for messages of type topicUpdated.", + "type": "string", + "example": "Lunch Chat thread" + }, + "participants": { + "description": "Chat message content for messages of types participantAdded or participantRemoved.", + "type": "array", + "items": { + "$ref": "#/definitions/ChatParticipant" + } + }, + "initiatorCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel" + } + } + }, + "ChatMessage": { + "description": "Chat message.", + "required": [ + "createdOn", + "id", + "sequenceId", + "type", + "version" + ], + "type": "object", + "properties": { + "id": { + "description": "The id of the chat message. This id is server generated.", + "type": "string", + "example": "123456789" + }, + "type": { + "$ref": "#/definitions/ChatMessageType" + }, + "sequenceId": { + "description": "Sequence of the chat message in the conversation.", + "type": "string" + }, + "version": { + "description": "Version of the chat message.", + "type": "string" + }, + "content": { + "$ref": "#/definitions/ChatMessageContent" + }, + "senderDisplayName": { + "description": "The display name of the chat message sender. This property is used to populate sender name for push notifications.", + "type": "string", + "example": "Jane" + }, + "createdOn": { + "format": "date-time", + "description": "The timestamp when the chat message arrived at the server. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "example": "2020-10-30T10:50:50Z" + }, + "senderCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel" + }, + "deletedOn": { + "format": "date-time", + "description": "The timestamp (if applicable) when the message was deleted. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "example": "2020-10-30T10:50:50Z" + }, + "editedOn": { + "format": "date-time", + "description": "The last timestamp (if applicable) when the message was edited. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "example": "2020-10-30T10:50:50Z" + }, + "properties": { + "description": "Properties", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "ChatMessagesCollection": { + "description": "Collection of chat messages for a particular chat thread.", + "required": [ + "value" + ], + "type": "object", + "properties": { + "value": { + "description": "Collection of chat messages.", + "type": "array", + "items": { + "$ref": "#/definitions/ChatMessage" + } + }, + "nextLink": { + "description": "If there are more chat messages that can be retrieved, the next link will be populated.", + "type": "string", + "readOnly": true + } + } + }, + "UpdateChatMessageRequest": { + "description": "Request payload for updating a chat message.", + "type": "object", + "properties": { + "content": { + "description": "Chat message content.", + "type": "string", + "example": "Let's go for lunch together." + }, + "properties": { + "description": "Message properties", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "ChatParticipantsCollection": { + "description": "Collection of participants belong to a particular thread.", + "required": [ + "value" + ], + "type": "object", + "properties": { + "value": { + "description": "Chat participants.", + "type": "array", + "items": { + "$ref": "#/definitions/ChatParticipant" + } + }, + "nextLink": { + "description": "If there are more chat participants that can be retrieved, the next link will be populated.", + "type": "string", + "readOnly": true + } + } + }, + "AddChatParticipantsRequest": { + "description": "Participants to be added to the thread.", + "required": [ + "participants" + ], + "type": "object", + "properties": { + "participants": { + "description": "Participants to add to a chat thread.", + "type": "array", + "items": { + "$ref": "#/definitions/ChatParticipant" + } + } + } + }, + "AddChatParticipantsResult": { + "description": "Result of the add chat participants operation.", + "type": "object", + "properties": { + "invalidParticipants": { + "description": "The participants that failed to be added to the chat thread.", + "type": "array", + "items": { + "$ref": "#/definitions/CommunicationError" + }, + "readOnly": true + } + } + }, + "CreateChatThreadRequest": { + "description": "Request payload for creating a chat thread.", + "required": [ + "topic" + ], + "type": "object", + "properties": { + "topic": { + "description": "The chat thread topic.", + "type": "string", + "example": "Lunch Thread" + }, + "participants": { + "description": "Participants to be added to the chat thread.", + "type": "array", + "items": { + "$ref": "#/definitions/ChatParticipant" + } + } + } + }, + "ChatThreadProperties": { + "description": "Chat thread.", + "required": [ + "createdByCommunicationIdentifier", + "createdOn", + "id", + "topic" + ], + "type": "object", + "properties": { + "id": { + "description": "Chat thread id.", + "type": "string", + "example": "19:uni01_uy5ucb66ugp3lrhe7pxso6xx4hsmm3dl6eyjfefv2n6x3rrurpea@thread.v2" + }, + "topic": { + "description": "Chat thread topic.", + "type": "string", + "example": "Lunch Chat thread" + }, + "createdOn": { + "format": "date-time", + "description": "The timestamp when the chat thread was created. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "example": "2020-10-30T10:50:50Z" + }, + "createdByCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel" + }, + "deletedOn": { + "format": "date-time", + "description": "The timestamp when the chat thread was deleted. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "example": "2020-10-30T10:50:50Z" + } + } + }, + "CreateChatThreadResult": { + "description": "Result of the create chat thread operation.", + "type": "object", + "properties": { + "chatThread": { + "$ref": "#/definitions/ChatThreadProperties" + }, + "invalidParticipants": { + "description": "The participants that failed to be added to the chat thread.", + "type": "array", + "items": { + "$ref": "#/definitions/CommunicationError" + }, + "readOnly": true + } + } + }, + "ChatThreadItem": { + "description": "Summary information of a chat thread.", + "required": [ + "id", + "topic" + ], + "type": "object", + "properties": { + "id": { + "description": "Chat thread id.", + "type": "string", + "example": "19:uni01_uy5ucb66ugp3lrhe7pxso6xx4hsmm3dl6eyjfefv2n6x3rrurpea@thread.v2" + }, + "topic": { + "description": "Chat thread topic.", + "type": "string", + "example": "Lunch Chat thread" + }, + "deletedOn": { + "format": "date-time", + "description": "The timestamp when the chat thread was deleted. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "example": "2020-10-30T10:50:50Z" + }, + "lastMessageReceivedOn": { + "format": "date-time", + "description": "The timestamp when the last message arrived at the server. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.", + "type": "string", + "readOnly": true, + "example": "2020-10-30T10:50:50Z" + } + } + }, + "ChatThreadsItemCollection": { + "description": "Collection of chat threads.", + "required": [ + "value" + ], + "type": "object", + "properties": { + "value": { + "description": "Collection of chat threads.", + "type": "array", + "items": { + "$ref": "#/definitions/ChatThreadItem" + } + }, + "nextLink": { + "description": "If there are more chat threads that can be retrieved, the next link will be populated.", + "type": "string", + "readOnly": true + } + } + }, + "UpdateChatThreadRequest": { + "description": "Request payload for updating a chat thread.", + "type": "object", + "properties": { + "topic": { + "description": "Chat thread topic.", + "type": "string", + "example": "Lunch Thread" + } + } + } + }, + "parameters": { + "ApiVersionParameter": { + "in": "query", + "name": "api-version", + "description": "Version of API to invoke.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "Endpoint": { + "in": "path", + "name": "endpoint", + "description": "The endpoint of the Azure Communication resource.", + "required": true, + "type": "string", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "client" + } + }, + "securityDefinitions": { + "Authorization": { + "type": "apiKey", + "name": "Authorization", + "in": "header", + "description": "An ACS (Azure Communication Services) user access token." + } + }, + "security": [ + { + "Authorization": [] + } + ], + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "#/parameters/Endpoint" + } + ] + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Conversations_ListChatReadReceiptsWithPageSize.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Conversations_ListChatReadReceiptsWithPageSize.json new file mode 100644 index 000000000000..9386c3cf4fb7 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Conversations_ListChatReadReceiptsWithPageSize.json @@ -0,0 +1,69 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2021-04-05-preview6", + "chatThreadId": "19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2", + "maxPageSize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "senderCommunicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + } + }, + "chatMessageId": "1591137790240", + "readOn": "2020-06-06T05:55:41.6460000Z" + }, + { + "senderCommunicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a" + } + }, + "chatMessageId": "1591768249318", + "readOn": "2020-06-06T05:55:41.6460000Z" + } + ], + "nextLink": "https://contoso.westus.communications.azure.com/chat/threads/19:453dafb77b26481ea2e73bcada0324af@thread.v2/readReceipts?skip=2&maxPageSize=2&api-version=2021-04-05-preview6" + } + }, + "401": { + "body": { + "error": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + } + }, + "403": { + "body": { + "error": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + } + }, + "429": { + "body": { + "error": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + } + }, + "503": { + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Conversations_SendChatReadReceipt.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Conversations_SendChatReadReceipt.json new file mode 100644 index 000000000000..5697ceb4b422 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Conversations_SendChatReadReceipt.json @@ -0,0 +1,45 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2021-04-05-preview6", + "chatThreadId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + "sendReadReceiptRequest": { + "chatMessageId": "1591137790240" + } + }, + "responses": { + "200": {}, + "401": { + "body": { + "error": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + } + }, + "403": { + "body": { + "error": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + } + }, + "429": { + "body": { + "error": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + } + }, + "503": { + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_DeleteChatMessage.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_DeleteChatMessage.json new file mode 100644 index 000000000000..7392dbd0ce13 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_DeleteChatMessage.json @@ -0,0 +1,43 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2021-04-05-preview6", + "chatThreadId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + "chatMessageId": "1591768249318" + }, + "responses": { + "204": {}, + "401": { + "body": { + "error": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + } + }, + "403": { + "body": { + "error": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + } + }, + "429": { + "body": { + "error": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + } + }, + "503": { + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_GetChatMessage.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_GetChatMessage.json new file mode 100644 index 000000000000..a0148a7fdc2b --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_GetChatMessage.json @@ -0,0 +1,61 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2021-04-05-preview6", + "chatThreadId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + "chatMessageId": "1591768249318" + }, + "responses": { + "200": { + "body": { + "id": "1591768249318", + "sequenceId": "1", + "type": "text", + "version": "1599016601134", + "content": { + "message": "Let's head out for lunch in 15 minutes." + }, + "senderDisplayName": "Jane", + "createdOn": "2020-06-10T05:50:49.3180000Z", + "senderCommunicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + } + } + } + }, + "401": { + "body": { + "error": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + } + }, + "403": { + "body": { + "error": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + } + }, + "429": { + "body": { + "error": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + } + }, + "503": { + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_ListChatMessagesWithPageSize.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_ListChatMessagesWithPageSize.json new file mode 100644 index 000000000000..8be72a33e4d0 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_ListChatMessagesWithPageSize.json @@ -0,0 +1,157 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2021-04-05-preview6", + "chatThreadId": "19:453dafb77b26481ea2e73bcada0324af@thread.v2", + "maxPageSize": 5 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "1593107077690", + "type": "text", + "version": "1593107077683", + "sequenceId": "5", + "content": { + "message": "So where should we get lunch from today?" + }, + "senderDisplayName": "Jane", + "createdOn": "2020-06-25T17:44:37.6830000Z", + "senderCommunicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + } + } + }, + { + "id": "1593107077683", + "type": "text", + "sequenceId": "4", + "version": "1593107077683", + "content": { + "message": "Let's use this chat to decide what to get for lunch today." + }, + "senderDisplayName": "Jane", + "createdOn": "2020-06-25T17:44:37.6830000Z", + "senderCommunicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + } + } + }, + { + "id": "1593107046498", + "type": "text", + "sequenceId": "3", + "version": "1593107046498", + "content": { + "message": "Good morning everyone!" + }, + "senderDisplayName": "Jane", + "createdOn": "2020-06-25T17:44:06.4980000Z", + "senderCommunicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + } + } + }, + { + "id": "1593106976785", + "type": "topicUpdated", + "sequenceId": "2", + "version": "1593106976785", + "content": { + "initiatorCommunicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + } + }, + "topic": "Lunch" + }, + "createdOn": "2020-06-25T17:42:56.7850000Z" + }, + { + "id": "1593106976753", + "type": "participantAdded", + "version": "1593106976753", + "sequenceId": "1", + "content": { + "initiatorCommunicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + } + }, + "participants": [ + { + "communicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + } + } + }, + { + "communicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10c", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10c" + } + } + }, + { + "communicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10d", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10d" + } + } + } + ] + }, + "createdOn": "2020-06-25T17:42:56.7530000Z" + } + ], + "nextLink": "https://contoso.westus.communications.azure.com/chat/threads/19:453dafb77b26481ea2e73bcada0324af@thread.v2/messages?syncState=3e4700000031393a756e6930315f7a626e68336e74326466756666657a6333736f7837646f67377766686b36793571653272776c6e66686c68647a69726968647071407468726561642e763201451fe6e77201000004357fea72010000&startTime=0&maxPageSize=5&api-version=2021-04-05-preview6" + } + }, + "401": { + "body": { + "error": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + } + }, + "403": { + "body": { + "error": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + } + }, + "429": { + "body": { + "error": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + } + }, + "503": { + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_SendChatMessage.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_SendChatMessage.json new file mode 100644 index 000000000000..3c37cb69139c --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_SendChatMessage.json @@ -0,0 +1,53 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2021-04-05-preview6", + "chatThreadId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + "sendChatMessageRequest": { + "content": "Let's head out for lunch in 15 minutes.", + "senderDisplayName": "Jane" + } + }, + "responses": { + "201": { + "headers": { + "Location": "https://contoso.westus.communications.azure.com/chat/threads/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/messages/1593072104708" + }, + "body": { + "id": "1593072104708" + } + }, + "401": { + "body": { + "error": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + } + }, + "403": { + "body": { + "error": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + } + }, + "429": { + "body": { + "error": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + } + }, + "503": { + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_SendTypingNotification.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_SendTypingNotification.json new file mode 100644 index 000000000000..c49f8efc76e7 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_SendTypingNotification.json @@ -0,0 +1,42 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2021-04-05-preview6", + "chatThreadId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345" + }, + "responses": { + "200": {}, + "401": { + "body": { + "error": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + } + }, + "403": { + "body": { + "error": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + } + }, + "429": { + "body": { + "error": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + } + }, + "503": { + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_UpdateChatMessage.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_UpdateChatMessage.json new file mode 100644 index 000000000000..b65428806bf6 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Messages_UpdateChatMessage.json @@ -0,0 +1,47 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "content-type": "application/merge-patch+json", + "api-version": "2021-04-05-preview6", + "chatThreadId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + "chatMessageId": "1591768249318", + "updateChatMessageRequest": { + "content": "Updated message content" + } + }, + "responses": { + "204": {}, + "401": { + "body": { + "error": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + } + }, + "403": { + "body": { + "error": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + } + }, + "429": { + "body": { + "error": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + } + }, + "503": { + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Participants_AddChatParticipants.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Participants_AddChatParticipants.json new file mode 100644 index 000000000000..2c5550f803f9 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Participants_AddChatParticipants.json @@ -0,0 +1,91 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2021-04-05-preview6", + "chatThreadId": "19:f2167429acf6482880c6b7790a9086c1@thread.v2", + "addChatParticipantsRequest": { + "participants": [ + { + "communicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a" + } + }, + "displayName": "Alex", + "shareHistoryTime": "2020-06-06T05:55:41Z" + }, + { + "communicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + } + }, + "displayName": "Peter", + "shareHistoryTime": "2020-06-06T05:55:41Z" + }, + { + "communicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10c", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10c" + } + }, + "displayName": "Rama", + "shareHistoryTime": "2020-06-06T05:55:41Z" + } + ] + } + }, + "responses": { + "201": { + "body": { + "invalidParticipants": [ + { + "target": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10c", + "code": "403", + "message": "Permissions check failed" + }, + { + "target": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a", + "code": "404", + "message": "Not found" + } + ] + } + }, + "401": { + "body": { + "error": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + } + }, + "403": { + "body": { + "error": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + } + }, + "429": { + "body": { + "error": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + } + }, + "503": { + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Participants_ListChatParticipantsWithPageSize.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Participants_ListChatParticipantsWithPageSize.json new file mode 100644 index 000000000000..822ef846c3e8 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Participants_ListChatParticipantsWithPageSize.json @@ -0,0 +1,69 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2021-04-05-preview6", + "chatThreadId": "19:f2167429acf6482880c6b7790a9086c1@thread.v2", + "maxPageSize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "communicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a" + } + }, + "displayName": "Jane", + "shareHistoryTime": "2020-06-06T05:55:41Z" + }, + { + "communicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + } + }, + "displayName": "Alex", + "shareHistoryTime": "2020-06-06T05:55:41Z" + } + ], + "nextLink": "https://contoso.westus.communications.azure.com/chat/threads/19:453dafb77b26481ea2e73bcada0324af@thread.v2/participants?skip=2&maxPageSize=2&api-version=2021-04-05-preview6" + } + }, + "401": { + "body": { + "error": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + } + }, + "403": { + "body": { + "error": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + } + }, + "429": { + "body": { + "error": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + } + }, + "503": { + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Participants_RemoveChatParticipant.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Participants_RemoveChatParticipant.json new file mode 100644 index 000000000000..89802e325387 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Participants_RemoveChatParticipant.json @@ -0,0 +1,48 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2021-04-05-preview6", + "chatThreadId": "19:f2167429acf6482880c6b7790a9086c1@thread.v2", + "participantCommunicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + } + } + }, + "responses": { + "204": {}, + "401": { + "body": { + "error": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + } + }, + "403": { + "body": { + "error": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + } + }, + "429": { + "body": { + "error": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + } + }, + "503": { + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_CreateChatThread.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_CreateChatThread.json new file mode 100644 index 000000000000..1632996cfa2a --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_CreateChatThread.json @@ -0,0 +1,111 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2021-04-05-preview6", + "createChatThreadRequest": { + "topic": "Lunch", + "participants": [ + { + "communicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a" + } + }, + "displayName": "Jane" + }, + { + "communicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + } + }, + "displayName": "Alex" + }, + { + "communicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10c", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10c" + } + }, + "displayName": "Bob" + }, + { + "communicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10d", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10d" + } + }, + "displayName": "Peter" + } + ] + } + }, + "responses": { + "201": { + "headers": { + "Location": "https://contoso.westus.communications.azure.com/chat/threads/19%3Auni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2" + }, + "body": { + "chatThread": { + "id": "19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2", + "topic": "Lunch", + "createdOn": "2020-06-06T05:55:41.6460000Z", + "createdByCommunicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a" + } + } + }, + "invalidParticipants": [ + { + "target": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10c", + "code": "403", + "message": "Permissions check failed" + }, + { + "target": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10d", + "code": "404", + "message": "Not found" + } + ] + } + }, + "401": { + "body": { + "error": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + } + }, + "403": { + "body": { + "error": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + } + }, + "429": { + "body": { + "error": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + } + }, + "503": { + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_CreateChatThreadWithIdempotencyToken.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_CreateChatThreadWithIdempotencyToken.json new file mode 100644 index 000000000000..4bd465bfb78e --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_CreateChatThreadWithIdempotencyToken.json @@ -0,0 +1,112 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2021-04-05-preview6", + "idempotency-token": "35dd6e71-251b-5e29-8376-ba93d09c3fbf", + "createChatThreadRequest": { + "topic": "Lunch", + "participants": [ + { + "communicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a" + } + }, + "displayName": "Jane" + }, + { + "communicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + } + }, + "displayName": "Alex" + }, + { + "communicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10c", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10c" + } + }, + "displayName": "Bob" + }, + { + "communicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10d", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10d" + } + }, + "displayName": "Peter" + } + ] + } + }, + "responses": { + "201": { + "headers": { + "Location": "https://contoso.westus.communications.azure.com/chat/threads/19%3Auni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2" + }, + "body": { + "chatThread": { + "id": "19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2", + "topic": "Lunch", + "createdOn": "2020-06-06T05:55:41.6460000Z", + "createdByCommunicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10a" + } + } + }, + "invalidParticipants": [ + { + "target": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10c", + "code": "403", + "message": "Permissions check failed" + }, + { + "target": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10d", + "code": "404", + "message": "Not found" + } + ] + } + }, + "401": { + "body": { + "error": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + } + }, + "403": { + "body": { + "error": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + } + }, + "429": { + "body": { + "error": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + } + }, + "503": { + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_DeleteChatThread.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_DeleteChatThread.json new file mode 100644 index 000000000000..21f2d9b6d6f2 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_DeleteChatThread.json @@ -0,0 +1,42 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2021-04-05-preview6", + "chatThreadId": "19:9525281ac1f947fc884bcee1a9f983c2@thread.v2" + }, + "responses": { + "204": {}, + "401": { + "body": { + "error": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + } + }, + "403": { + "body": { + "error": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + } + }, + "429": { + "body": { + "error": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + } + }, + "503": { + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_GetChatThread.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_GetChatThread.json new file mode 100644 index 000000000000..bc0611625ca8 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_GetChatThread.json @@ -0,0 +1,54 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2021-04-05-preview6", + "chatThreadId": "19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2" + }, + "responses": { + "200": { + "body": { + "id": "19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2", + "topic": "Lunch", + "createdOn": "2020-06-06T05:55:41.6460000Z", + "createdByCommunicationIdentifier": { + "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "communicationUser": { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + } + } + } + }, + "401": { + "body": { + "error": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + } + }, + "403": { + "body": { + "error": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + } + }, + "429": { + "body": { + "error": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + } + }, + "503": { + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_ListChatThreadsWithPageSize.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_ListChatThreadsWithPageSize.json new file mode 100644 index 000000000000..6698ae1b3a48 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_ListChatThreadsWithPageSize.json @@ -0,0 +1,74 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2021-04-05-preview6", + "maxPageSize": 5 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2", + "topic": "Chat with Samantha", + "lastMessageReceivedOn": "2020-06-06T05:55:41.6460000Z" + }, + { + "id": "19:a0dfe5fc10e04a7f8d8a64d455f4196d@thread.v2", + "topic": "Presentation Brainstorming", + "lastMessageReceivedOn": "2020-06-06T05:55:41.6460000Z" + }, + { + "id": "19:uni01_n242d2bzammtwxiib7pbjtozeevjqzavzn654ku3dajocexfo2na@thread.v2", + "topic": "Chat with Alex", + "lastMessageReceivedOn": "2020-06-06T05:55:41.6460000Z" + }, + { + "id": "19:0062022a28be4e0983734f7e45cd8566@thread.v2", + "topic": "Lunch", + "deletedOn": "2020-07-07T05:55:41.6460000Z", + "lastMessageReceivedOn": "2020-06-06T05:55:41.6460000Z" + }, + { + "id": "19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpe@thread.v2", + "topic": "Chat with Bob", + "lastMessageReceivedOn": "2020-06-06T05:55:41.6460000Z" + } + ], + "nextLink": "https://contoso.westus.communications.azure.com/chat/threads?syncState=W3sic3RhcnQiOiIyMDIwLTA2LTIzVDIzOjMyOjQ3LjMwNSswMDowMCIsImVuZCI6IjIwMjAtMDYtMjVUMDY6NTY6MjMuNjk2KzAwOjAwIn0seyJzdGFydCI6IjE5NzAtMDEtMDFUMDA6MDA6MDArMDA6MDAiLCJlbmQiOiIxOTcwLTAxLTAxVDAwOjAwOjAwKzAwOjAwIn1d&api-version=2021-04-05-preview6&maxPageSize=5" + } + }, + "401": { + "body": { + "error": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + } + }, + "403": { + "body": { + "error": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + } + }, + "429": { + "body": { + "error": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + } + }, + "503": { + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_UpdateChatThreadTopic.json b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_UpdateChatThreadTopic.json new file mode 100644 index 000000000000..854159ac7dfc --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2021-04-05-preview6/examples/Threads_UpdateChatThreadTopic.json @@ -0,0 +1,46 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "content-type": "application/merge-patch+json", + "api-version": "2021-04-05-preview6", + "chatThreadId": "19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2", + "updateChatThreadRequest": { + "topic": "Updated Thread Topic" + } + }, + "responses": { + "204": {}, + "401": { + "body": { + "error": { + "code": "Unauthorized", + "message": "Request is not authorized." + } + } + }, + "403": { + "body": { + "error": { + "code": "Forbidden", + "message": "User is not allowed to perform specified action." + } + } + }, + "429": { + "body": { + "error": { + "code": "TooManyRequests", + "message": "Rate limit exceeded." + } + } + }, + "503": { + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "The server is currently unable to handle the request." + } + } + } + } +} diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/readme.md b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/readme.md index e3a45fb78fe4..89fa036f60b8 100644 --- a/specification/communication/data-plane/Microsoft.CommunicationServicesChat/readme.md +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesChat/readme.md @@ -84,6 +84,17 @@ title: Azure Communication Services ``` +### Tag: package-chat-2021-04-05-preview6 + +These settings apply only when `--tag=package-2021-04-05-preview6` is specified on the command line. + +```yaml $(tag) == 'package-chat-2021-04-05-preview6' +input-file: + - preview/2021-04-05-preview6/communicationserviceschat.json +title: + Azure Communication Services +``` + --- # Code Generation