Send a text message with attachments from the business to a customer.
A message can include one or more attachments with a message type of
text. An attachment can be an image, PDF, or other file type, and it must be smaller than 100 MB.
Business Chat ensures that each attachment is available to the customer for 30 days. If, within that 30-day period, the Messaging Service Provider (MSP) platform sends a new message that includes a reference to an existing attachment, Business Chat extends the attachment’s availability for another 30 days. If the customer’s device is offline for 30 days or more, the device retrieves only attachments sent in the previous 30 days.
Get the Attachment Reference
An attachment sent by the MSP platform isn't included in the message JSON. Instead, the MSP platform adds a reference to the attachment in the Attachment dictionary.
To get the attachment reference, do the following:
Encrypt the attachment (see Encrypting an Attachment).
Authorize the attachment for upload by calling
GETrequest, passing in the size of the encrypted file attachment (see Authorizing an Attachment for Upload). This endpoint returns the
upload-urland metadata about the attachment.
Upload the encrypted file by sending a POST request to the
upload-url, which returns a file checksum for the uploaded file (see Uploading an Attachment).
Use the metadata about the attachment and the file checksum to create an Attachment dictionary, which represents the attachment reference that you include in the message JSON (see Adding Attachment Metadata to a Message).
Repeat these steps for each attachment in the array, as shown in , prior to sending the message.