Uploading an Attachment

Upload the encrypted file to Business Chat.


To upload the encrypted attachment to Business Chat, send a POST request to the URL returned by the /preUpload call (see Authorizing an Attachment for Upload), with the attachment in the body of the request.

Business Chat returns a JSON dictionary containing the fileChecksum field. Store the value from this field in the signature-base64 key in the Attachment dictionary.

When using Server Name Indication (SNI) (RFC 6066), upload the request in a secured TLS connection to the returned upload URL. The TLS client should set the TLS server hostname from the extracted hostname for the upload URL.

Sample Attachment Upload

POST [upload-url]content-length: upload-size-in-bytes {content is bytes of the encrypted attachment}
HTTP/1.1 200 OK content-type: application/json { "singleFile": { "fileChecksum": "file-signature-base64-encoded" }}

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.

Adding Attachment Metadata to a Message

Include an attachment in a text message to a customer.