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 Name | Type | Description | Required |
|---|---|---|---|
| conversationIdentifier | string | A unique identifier generated for the conversation. | Yes |
| sender | object | An object representing a messaging participant. The participant can be a rep or an end user. | Yes |
| sender.appType | string | The app type used for the conversation. Set this value to custom to represent a custom bot. | Yes |
| sender.subject | string | The Salesforce record ID of the external bot that you created as part of the setup. | Yes |
| sender.role | string | The role within the conversation. Set this value to chatbot. | Yes |
| conversationEntries | object | A 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.clientTimestamp | timestamp | This indicates the timestamp when the message was generated by the bot. | Yes |
| conversationEntries.entryPayload | object | The content of the conversation entry. | Yes |
| entryPayload.id | string | A unique ID for the interaction. Maximum size is 36 characters. This value must match the entryPayload.abstractMessage.id value in this payload. | Yes |
| entryPayload.entryType | string | The type of conversation entry. Set to Message for content messages, or TypingStartedIndicator / TypingStoppedIndicator for typing indicators. | Yes |
| entryPayload.messageReason | string | The reason for the message. | No |
| entryPayload.abstractMessage | object | The message details. For more information on abstractMessage, see Abstract Message. Required when entryType is Message. | Yes |
| abstractMessage.id | string | A unique ID for the interaction. This value must match the entryPayload.id value in this payload. | Yes |
| abstractMessage.messageType | string | The message type for the interaction. Set this value to StaticContentMessage, ChoicesMessage, or FormMessage. | Yes |
| abstractMessage.staticContent | object | The 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.formatType | text | The type of static content. | Yes |
| staticContent.text | text | The message as part of the conversation. Required when formatType is Text. | Yes |
| abstractMessage.inReplyToMessageId | string | The ID of the message this message is in reply to. | No |
| abstractMessage.customHandlingType | string | A custom handling type for the message. | No |
| abstractMessage.references | array | A list of references (for example, records or assets) associated with the message. See the sample payloads for the structure. | No |
| abstractMessage.contentCategory | string | A category that classifies the content of the message. | No |