Chat Thread - Get Chat Message
Gets a message by id.
GET {endpoint}/chat/threads/{chatThreadId}/messages/{chatMessageId}?api-version=2024-03-07
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
chat
|
path | True |
string |
The message id. |
chat
|
path | True |
string |
The thread id to which the message was sent. |
endpoint
|
path | True |
string |
The endpoint of the Azure Communication resource. |
api-version
|
query | True |
string |
Version of API to invoke. |
Request Header
Name | Required | Type | Description |
---|---|---|---|
Authorization | True |
string |
An ACS (Azure Communication Services) user access token. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Request successful. The action returns a |
|
401 Unauthorized |
Communication |
Unauthorized. |
403 Forbidden |
Communication |
Forbidden. |
429 Too Many Requests |
Communication |
Too many requests. |
Other Status Codes |
Communication |
Service unavailable. |
Security
Authorization
An ACS (Azure Communication Services) user access token.
Type:
apiKey
In:
header
Examples
Get Message
Sample request
GET https://contoso.westus.communications.azure.com/chat/threads/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/messages/1591768249318?api-version=2024-03-07
Sample response
{
"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"
}
},
"metadata": {
"someKey1": "someValue1",
"someKey2": "someValue2"
}
}
{
"error": {
"code": "Unauthorized",
"message": "Request is not authorized."
}
}
{
"error": {
"code": "Forbidden",
"message": "User is not allowed to perform specified action."
}
}
{
"error": {
"code": "TooManyRequests",
"message": "Rate limit exceeded."
}
}
{
"error": {
"code": "ServiceUnavailable",
"message": "The server is currently unable to handle the request."
}
}
Definitions
Name | Description |
---|---|
Chat |
An attachment in a chat message. |
Chat |
The type of attachment. |
Chat |
Chat message. |
Chat |
Content of a chat message. |
Chat |
The chat message type. |
Chat |
A participant of the chat thread. |
ChatAttachment
An attachment in a chat message.
Name | Type | Description |
---|---|---|
attachmentType |
The type of attachment. |
|
id |
string |
Id of the attachment |
name |
string |
The name of the attachment content. |
previewUrl |
string |
The URL where the preview of attachment can be downloaded |
url |
string |
The URL where the attachment can be downloaded |
ChatAttachmentType
The type of attachment.
Name | Type | Description |
---|---|---|
file |
string |
|
image |
string |
ChatMessage
Chat message.
Name | Type | Description |
---|---|---|
content |
Content of a chat message. |
|
createdOn |
string |
The timestamp when the chat message arrived at the server. The timestamp is in RFC3339 format: |
deletedOn |
string |
The timestamp (if applicable) when the message was deleted. The timestamp is in RFC3339 format: |
editedOn |
string |
The last timestamp (if applicable) when the message was edited. The timestamp is in RFC3339 format: |
id |
string |
The id of the chat message. This id is server generated. |
metadata |
object |
Message metadata. |
senderCommunicationIdentifier |
Communication |
|
senderDisplayName |
string |
The display name of the chat message sender. This property is used to populate sender name for push notifications. |
sequenceId |
string |
Sequence of the chat message in the conversation. |
type |
The chat message type. |
|
version |
string |
Version of the chat message. |
ChatMessageContent
Content of a chat message.
Name | Type | Description |
---|---|---|
attachments |
List of attachments for this message |
|
initiatorCommunicationIdentifier |
Communication |
|
message |
string |
Chat message content for messages of types text or html. |
participants |
Chat message content for messages of types participantAdded or participantRemoved. |
|
topic |
string |
Chat message content for messages of type topicUpdated. |
ChatMessageType
The chat message type.
Name | Type | Description |
---|---|---|
html |
string |
|
participantAdded |
string |
|
participantRemoved |
string |
|
text |
string |
|
topicUpdated |
string |
ChatParticipant
A participant of the chat thread.
Name | Type | Description |
---|---|---|
communicationIdentifier |
Communication |
|
displayName |
string |
Display name for the chat participant. |
shareHistoryTime |
string |
Time from which the chat history is shared with the participant. The timestamp is in RFC3339 format: |