Include an attachment in a text message to a customer.
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 (
\u) 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.
\u 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:
Place a Unicode object replacement character (
\u) at the text position where the attachment should appear in the message text.
Add the Attachment dictionary to the attachments array.