Server-Sent Events
The Server-Sent Events endpoint is the interface through which clients establish connections to server-sent events to receive messages and events from the server.
These messages encompass a variety of content, such as messages sent by agents or bots, system events, echoes of end-user messages, participant modifications, and similar events. Once a call is made to the endpoint, the browser keeps the connection open and receives the events from the server.
/eventrouter/v1/sse
GET
Standard header. The media types that the client can accept from the server. Valid media type is text/event-stream.
Standard header. The authorization token, where
String. The 15-character org ID of the Salesforce org where Messaging for In-App and Web is set up.
Last-Event-Id:
- First Term
This text defines the first term.
Property Name | Type | Description | Required |
---|---|---|---|
channelPlatformKey | string | Token used to send notifications to this device. | Yes |
channelType | string | The channel type. Set this value to “emedded_messaging” | Yes |
channelAddressIdentifier | The ID of the Messaging Channel record. | Yes | |
conversationId | The UUID of the conversation. The UUID must be in lowercase. | Yes | |
conversationEntry | object | An object representing a conversation entry that’s initiated by an agent, end user, bot, or auto-response. | Yes |
conversationEntry.senderDisplayName | The display name of the agent, end user, bot, or auto-response that initiated the conversation entry. Possible display names include Guest (for the end user), Agent, and Automated Process (from a Salesforce-generated automated process). | ||
conversationEntry.identifier | The ID of the conversation entry. | ||
conversationEntry.entryType | enum | The type of conversation entry. Examples of conversation entries include a block of message text, a participant change, a routing action, an agent status updates, and a typing status. | |
conversationEntry.entryPayload | The payload for the conversation entry that the SSE receives. The payload details depend on the entryType. For example, if entryType is “TypingStoppedIndicator”, then entryPayload includes the ID and timestamp details for the CONVERSATION_TYPING_STOPPED_INDICATOR event. "{"entryType":"TypingStoppedIndicator","id":"60582fd0-d697-43b4-9b39-e014d6d62760","timestamp":1713391878151}" See SSE Events Structure for a list of supported SSEs and their sample payloads. | ||
conversationEntry.sender | The participant who sent the conversation entry and the details associated with the conversation, including the role (role) of the participant that is responsible for the event, such as System, Chatbot, Agent, End User, Router, the app type (appType) used for the conversation, which is always set to “conversation”, and the unique subject ID (subject) of the sender participant. { "role": "System", "appType": "conversation", "subject": "005SB000000AEo5", "clientIdentifier": " } | Yes | |
conversationEntry.transcriptedTimestamp | The date and time (in UTC) when the conversation entry was received by the Salesforce server. | Yes | |
conversationEntry.clientTimestamp | The date and time (in UTC) when the conversation entry was sent by the client. | Yes |