Skip to main content

Upload Attachments

POST /attachments

To upload an attachment, you must first create a new attachment.

Endpoint URL

 https://api.mixin.one/attachments

Authentication and options

Authorization
Authorized
LimitationNo limitation

Payload

{
// Just leave them empty.
"attachment_id": "",
"upload_url": "",
"view_url": "",
}

Example request

curl -i -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/attachments --data PAYLOAD
attachment data
{
"data": {
"type": "attachment",
"attachment_id": "7a54e394-1626-4cd4-b967-543932c2a032",
// the url to view the attachment
"view_url": " ... ",
// the url to upload the attachment
"upload_url": " ... ",
}
}

Upload the Attachment

You will get the upload_url from the previous response. Now upload the attachment to upload_url, and then the attachment_id can be used sending images, videos, files and other messages.

Mixin Messenger uploads the attachments using HTTP and store them on the Amazon S3, see S3 documentation for more information.

Here is a code snippet to upload an attachment.