Upload attachments
PUT/inbox/v1/virtual-agent/conversations/:conversationId/attachments/:filename
This allows you to upload an attachment that you can send in a conversation. You need to upload the attachment first,
and then you can send a message with text and an attachment. For example, if you upload an attachment
to /inbox/v1/virtual-agent/conversations/attachments/cat.jpg, you can send that attachment by sending
{
"sendMessage": {
"text": "This is a cat!",
"attachment": "cat.jpg"
}
}
to /inbox/v1/virtual-agent/conversations/{conversationId}. The file name should be unique within a conversation and is visible to the contact
if they download your attachment.
The Content-Type header should contain the correct mime-type of the attachment (such as image/jpeg).
The Content-Length header should contain the size of the attachment in bytes. Attachments should be fewer than 10
megabytes to prevent error.
Request
Responses
- 200
- 400
- 401
- 404
The attachment is uploaded and ready to use in your conversation. Note: after uploading the attachment to Inbox 2.0, you still need to specifically send it to the contact
The request is malformed. This can happen because the filename contains an invalid character, or because the attachment type cannot be sent to the medium.
Unauthorized: when using an invalid or expired access token.
The conversation id does not exist or is no longer assigned to the virtual agent.