Send a Message Through a Chatbot

Enables you to send messages in a conversation through the third-party chatbot, including StaticContentMessage, ChoiceMessage, FormMessage, and typing indicators.

This API applies to the following product:

  • Bring Your Own Bot (BYOB)

For authentication details, see Generate an Access Token.

Sample payloads are provided for text messages, choice messages with buttons, choice messages with a carousel, messages in a form, typing started indicator, and typing stopped indicator.

v1/conversationEntry

POST

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

Format: application/json
String. Standard header. The format of the request body. Valid format is application/json. Required.

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

Format: <External Conversation Participant Integration Definition developer name>
String. Standard header. The ExtConvParticipantIntegDef developer name in the format {prefix}_{ExtConvParticipantIntegDef}. The prefix must match the developer name prefix of the corresponding ExternalClientApp. For example, Partnerapp_ExtConvParticipantIntegDef. Required.

Format: ExternalConversationParticipant
String. Standard header. Set this value to ExternalConversationParticipant. Required.

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

Property NameTypeDescriptionRequired
conversationIdentifierstringA unique identifier generated for the conversation.Yes
senderobjectAn object representing a messaging participant. The participant can be a rep or an end user.Yes
sender.appTypestringThe app type used for the conversation. Set this value to custom to represent a custom bot.Yes
sender.subjectstringThe Salesforce record ID of the external bot that you created as part of the setup.Yes
sender.rolestringThe role within the conversation. Set this value to chatbot.Yes
conversationEntriesobjectA list of conversation entries sent via a bot to Conversation. Each conversation entry is a message with the text format type. Currently, send exactly one entry per request (min: 1, max: 1).Yes
conversationEntries.clientTimestamptimestampThis indicates the timestamp when the message was generated by the bot.Yes
conversationEntries.entryPayloadobjectThe content of the conversation entry.Yes
entryPayload.idstringA unique ID for the interaction. Maximum size is 36 characters. This value must match the entryPayload.abstractMessage.id value in this payload.Yes
entryPayload.entryTypestringThe type of conversation entry. Set to Message for content messages, or TypingStartedIndicator / TypingStoppedIndicator for typing indicators.Yes
entryPayload.messageReasonstringThe reason for the message.No
entryPayload.abstractMessageobjectThe message details. For more information on abstractMessage, see Abstract Message. Required when entryType is Message.Yes
abstractMessage.idstringA unique ID for the interaction. This value must match the entryPayload.id value in this payload.Yes
abstractMessage.messageTypestringThe message type for the interaction. Set this value to StaticContentMessage, ChoicesMessage, or FormMessage.Yes
abstractMessage.staticContentobjectThe details for the static content. For messages, set formatType to Text, and set text to the message content. Required when messageType is StaticContentMessage.Yes
staticContent.formatTypetextThe type of static content.Yes
staticContent.texttextThe message as part of the conversation. Required when formatType is Text.Yes
abstractMessage.inReplyToMessageIdstringThe ID of the message this message is in reply to.No
abstractMessage.customHandlingTypestringA custom handling type for the message.No
abstractMessage.referencesarrayA list of references (for example, records or assets) associated with the message. See the sample payloads for the structure.No
abstractMessage.contentCategorystringA category that classifies the content of the message.No