Message Interaction

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

This API applies to the following products:

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

This API is available in version 61.0 and later.

The Message interaction displays inbound messages in the Service Console. When an end user sends a message, call the Interactions API to notify Salesforce of the event.

If a conversation corresponding to the passed-in conversation channel address identifier and end user client identifier exists, the interaction is associated with the conversation and the existing conversationIdentifier value is returned. If a conversation corresponding to the passed-in conversation channel address identifier and end user client identifier doesn’t exist, a conversation is created, a MessagingSession record is created, a MessagingEndUser record is created, and a new conversationIdentifier value is returned.

For Bring You Own Channel for CCaaS, if message routing is Salesforce-owned, Salesforce uses the Omni-Channel flows to route inbound messages and file attachments to the next available rep. If message routing is handled by a partner system, subscribe to the Pub/Sub API to listen to the routingRequested event.

The rep accepts the inbound messaging call and returns an outbound message to the end user.

v1/interactions

POST

Format: Bearer <Salesforce Access Token>
String. Standard header. Used to authenticate the user, where <Salesforce Access Token> is the Salesforce access token used as the bearer token to make requests to the Interaction Service APIs. Required.

Format: multipart/form-data
String. Standard header. Format of the request payload. Required for any request that includes a body.

Format: <Salesforce Org ID>
String. Custom header. The Salesforce org. <Salesforce Org ID> is the 15-character Org ID of the Salesforce org. Required.

Format: <UUID>
String. Custom header. Universally Unique Identifier (<UUID>) that references and tracks this request. Required.

Format: <AuthorizationContext>
String. Custom header. Additional information for the request authorization used to authenticate and validate requests against the connected app scopes.

  • For Bring Your Own Channel for CCaaS, set <AuthorizationContext> to the developer name of the ConversationChannelDefinition record. For example, Partner1_ChannelDefinition1. Required.
  • For Bring Your Own Channel for Messaging, set <AuthorizationContext> to the developer name of the ConversationChannelDefinition record. For example, Partner1_ChannelDefinition1. Required.
  • don’t set this header.
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.payloadarrayThe interaction payload.Yes
interactions.payload.idstringThe unique ID for the interaction.Yes
interaction.payload.entryTypestringThe conversation entry type. Valid values are:
- Message–When a conversation participant sends a message.
- TypingStartedIndicator–When a conversation participant starts typing.
- TypingStoppedIndicator–When a conversation participant stops typing.
- MessageDeliveryFailed–When a message fails to send.
Yes
interaction.payload.abstractMessageobjectThe message details. This object only applies if entryType is set to Message. Set messageType to StaticContentMessage. The id represents the unique ID for the interaction and must match the interactions.payload.id value in this payload. Set staticContent.formatType to Text, which represents the type of value to be formatted. The staticContent.text value represents the content of the message.Yes
routingAttributesobjectAn optional object containing custom data to use for routing the conversation. This data helps Salesforce direct the conversation to the most appropriate rep or queue. How you use this parameter depends on your channel type.
For Bring Your Own Channel for Messaging:
- If you add support for custom parameters and the messaging end user sends the first message, set routingAttributes to a key-value pair, where key is set to the channel variable name in the parameter mapping, and value is set to the value of the custom parameter in Salesforce. This creates a direct map between a variable in your channel and a field in Salesforce. The value length must be less than or equal to the Maximum Length that the Salesforce admin set for the custom parameter in Messaging Settings.
- If your implementation uses proactive messaging where an AI agent sends the first message, set routingAttributes in the /conversation API.
If conversation routing is partner-owned for Bring Your Own Channel for CCaaS and you add support for custom parameters, use the /route API to configure the routing attributes instead.
No