Chat Thread - Upload Chat Image
Upload an image in a thread, on behalf of a user.
POST {endpoint}/chat/threads/{chatThreadId}/images?api-version=2024-03-15-preview
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
chat
|
path | True |
string |
Thread id where the uploaded image belongs to. (Teams meeting only) |
endpoint
|
path | True |
string |
The endpoint of the Azure Communication resource. |
api-version
|
query | True |
string |
Version of API to invoke. |
Request Header
Media Types: "application/octet-stream"
Name | Required | Type | Description |
---|---|---|---|
Authorization | True |
string |
An ACS (Azure Communication Services) user access token. |
image-filename |
string |
The file name of the image. |
Request Body
Media Types: "application/octet-stream"
Name | Type | Description |
---|---|---|
chatImageFile |
string |
Image binary data, allowed image formats: jpeg, png, gif, heic, webp |
Responses
Name | Type | Description |
---|---|---|
201 Created |
Uploaded successfully, the |
|
Other Status Codes |
Error response describing why the operation failed. |
Security
Authorization
An ACS (Azure Communication Services) user access token.
Type:
apiKey
In:
header
Examples
Upload Image
Sample Request
POST https://contoso.westus.communications.azure.com/chat/threads/19:34adfa4f-cedf-4dc0-ba29-b6d1a69ab345@thread.v2/images?api-version=2024-03-15-preview
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACklEQVQYV2P4DwABAQEAWk1v8QAAAABJRU5ErkJggg=="
Sample Response
Location: /chat/threads/19:34adfa4f-cedf-4dc0-ba29-b6d1a69ab345@thread.v2/images/0-eus-d2-fb42e272282ebb6ef76a3aedd1974433
{
"id": "0-eus-d2-fb42e272282ebb6ef76a3aedd1974433",
"attachmentType": "inlineImage",
"name": "sample.png"
}
Definitions
Name | Description |
---|---|
Chat |
The type of attachment. |
Error |
Error response information. |
Error |
Error detail information. |
Error |
Wrapper for error response to follow ARM guidelines. |
Upload |
Result payload for uploading an image. |
ChatAttachmentType
The type of attachment.
Name | Type | Description |
---|---|---|
file |
string |
|
image |
string |
Error
Error response information.
Name | Type | Description |
---|---|---|
code |
string |
Error code. |
details |
An array of error detail objects. |
|
message |
string |
Error message. |
ErrorDetail
Error detail information.
Name | Type | Description |
---|---|---|
code |
string |
Error code. |
message |
string |
Error message. |
ErrorResponse
Wrapper for error response to follow ARM guidelines.
Name | Type | Description |
---|---|---|
error |
The error response. |
UploadChatImageResult
Result payload for uploading an image.
Name | Type | Description |
---|---|---|
attachmentType |
The type of attachment. |
|
id |
string |
A server-generated image id. |
name |
string |
The name including file extension type of the attachment. |