Article

Adding Attachment Metadata to a Message

Include an attachment in a text message to a customer.

Overview

A text message may contain one or more attachments. To attach a file, the Customer Service Platform (CSP) uploads each attachment to the Business Chat service. After uploading the attachment, the CSP creates the Attachment dictionary, which contains metadata representing the attachment.

The message text must have one Unicode object replacement character (\uFFFC) for each attachment in the attachments array. For example, if the message includes two attachments, the message text must contain two Unicode object replacement characters. Extra replacement characters or attachment array items are ignored.

Including the \uFFFC replacement character tells Messages where to place the attachment when the customer sees the message on their device. The order of the replacement character within the text corresponds to the order of attachments in the attachment array. Messages displays the first attachment at the first replacement character, the second attachment in the array at the second replacement character, and so on.

To include an attachment in a message:

  1. Place a Unicode object replacement character (\uFFFC) at the text position where the attachment should appear in the message text.

  2. Add the Attachment dictionary to the attachments array.

Example Attachment

{ "body": "\uFFFc", "attachments": [{ "name": "picture.png", "file-size": "67497", "mime-type": "image/png", "signature-base64": "AThQ82TySl <truncated>", "decryption-key": "005269B32EF12645D <truncated>", "mmcs-url": "https://p54-content.icloud.com", "mmcs-owner": "M61383834656464662d6 <truncated>" }], "sourceId": "a884eddf-<truncated>", "destinationId": "urn:mbid:AQAAYyUbut6E4B3T9FLv5EbG/ <truncated>", "v": 1, "type": "text", "id": "9143ac3c-<truncated>"}
{The response body is empty.}

See Also

Message Attachments

Sending Messages with Attachments

Send a text message with attachments from the business to a customer.

Encrypting an Attachment

Secure the contents of the attachment.

Authorizing an Attachment for Upload

Get the URL needed to upload the file by authorizing the attachment for upload to Business Chat.

object preUploadResponseBody

The JSON dictionary keys contained in the /preUpload body.

Uploading an Attachment

Upload the encrypted file to Business Chat.