File Attachment Interaction

Sends an AttachmentInteraction interaction event from the client side to Salesforce when an end user sends a file.

This API applies to the following products:

  • Bring Your Own Channel for Messaging
  • Bring Your Own Channel for Contact Center as a Service

This API is available in version 61.0 and later.

When a file attachment is sent, a “Success” response means the Salesforce system has received and acknowledged the request and will begin uploading the file. During this time, the Service Console displays the message, “Uploading file…”. To track the upload status and get the latest results, subscribe to the MessageUpdated outbound event.

The request accepts non-ASCII or binary files and supports the most common image, audio, and video file types.

Files can only be sent one at a time, and the maximum size of each file is 25 MB. The storage limit is the maximum size that your storage container allows.

v1/interactions

POST

Authorization: Bearer <Salesforce access token>
String. Standard header. The authorization token, where \<token\> is the JSON Web Token (JWT). Required.

Content-Type: <Request body format>
String. Standard header. The format of the request body. Valid format is multipart/form-data. Required.

OrgId: <Salesforce Org Id>
String. Standard header. The 15-character Org ID of the Salesforce org. Required.

AuthorizationContext: <ConversationChannel Definition developer name>
String. Standard header. The ConversationChannelDefinition developer name in the format {prefix}_{ConversationChannelDefinitionName}. The prefix must match the developer name prefix of the corresponding connected app. For example, Partner1_ChannelDefinition1. Required.

RequestId: <GUID>
String. Standard header. A globally unique ID (GUID). Required.

For example,

Property NameTypeDescriptionRequired
tostringThe channel address identifier. This is the globally unique ID for the conversation channel (MessagingChannel.ChannelAddressIdentifier).Yes
fromstringThe end user client identifier. This value comes from the partner system and can be up to 240 characters long.Yes
interactionsarrayA list of interactions that are initiated by a messaging or voice rep or end user.Yes
interactions.timestampbooleanThe date and time when the interaction was received by the Salesforce server.Yes
interactions.interactionTypestringThe type of interaction. Possible values include:
- EntryInteraction to represent the type of interaction, such as an inbound message, a message sent failure, or a typing start or stop indicator.
- AttachmentInteraction to represent a file attachment that comes within the inbound messaging request.
Yes
interactions.idstringThe unique ID for the interaction.Yes
interactions.attachmentIndexintegerThe zero-based index value of the file in the list of attachments for the interaction. Only one file per interaction is allowed, so set this value to 0 (zero).Yes
interactions.contentLengthintegerThe size of the file data measured in bytes. Specify the correct file size to ensure the file attachment uploads properly.Yes
interactions.textstringThe text, if any, that's sent with the file.No