Service Presence Developer Guide
Service Presence Developer Guide
Guide
Version 62.0, Winter ’25
names and marks. Other marks appearing herein may be trademarks of their respective owners.
CONTENTS
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
CHAPTER 1 Omni-Channel Developer Guide
In this chapter ... Customize your Omni-Channel records and console integration with Omni-Channel API objects and
console methods.
• Omni-Channel
Objects
Omni-Channel routes work items to queues, agents, skills, and even Einstein Bots (on supported channels)
based on defined routing logic. Depending on your business needs, you can use different ways to route
• Omni-Channel
work, including Omni-Channel flows.
Metadata API Types
• Omni-Channel Use Omni-Channel to manage the priority of work items, which makes it a cinch to route important work
Components for the items to agents quickly. Manage your agents’ capacity to take on work items so that they’re given only
Salesforce Console the number of assignments that they can handle. You can also define which agents can work on different
types of assignments. For example, you can create one group of agents to respond to leads and sales
• External Routing for
inquiries, and another group that helps customers with support questions.
Omni-Channel
Routing logic is applied when work is assigned to an owner. If field values on the work item are changed
after the item is routed, the routing logic isn’t reapplied.
1
Omni-Channel Developer Guide Omni-Channel Objects
Omni-Channel Objects
Use an API to create, retrieve, update or delete records, such as accounts, leads, and custom objects. The Salesforce data model includes
several objects that let you control and customize your Omni-Channel records, including Omni-Channel users, routing configurations,
and statuses.
For more information on Salesforce APIs, see Which API Do I Use? in Salesforce Help.
• AgentWork
• AgentWorkSkill
• OmniSupervisorConfig
• OmniSupervisorConfigAction
• OmniSupervisorConfigGroup
• OmniSupervisorConfigProfile
• OmniSupervisorConfigQueue
• OmniSupervisorConfigSkill
• OmniSupervisorConfigTab
• OmniSupervisorConfigUser
• PendingServiceRouting
• PresenceConfigDeclineReason
• PresenceDeclineReason
• PresenceUserConfig
• PresenceUserConfigUser
• QueueRoutingConfig
• QueueSobject
• ServiceChannel
• ServiceChannelFieldPriority
• ServiceChannelStatus
• ServicePresenceStatus
• ServiceResource
• SkillRequirement
• UserServicePresence
2
Omni-Channel Developer Guide Omni-Channel Components for the Salesforce Console
• Queue
• QueueRoutingConfig
• ServiceChannel
• ServicePresenceStatus
• WorkSkillRouting
• WorkSkillRoutingAttribute
If you need more information on the Salesforce Metadata API, see the Metadata API Developer Guide.
3
Omni-Channel Developer Guide Omni-Channel Components for the Salesforce Console
Integration Toolkit
4
Omni-Channel Developer Guide Omni-Channel Components for the Salesforce Console
Integration Toolkit
• closeAgentWork
• declineAgentWork
• getAgentWorks
• getAgentWorkload
• getServicePresenceStatusChannels
• getServicePresenceStatusId
• login
• logout
• setServicePresenceStatus
• Methods for Omni-Channel Console Events
sforce.console.ConsoleEvent. Fired when a primary tab or subtab with a • id—the ID of the closed tab
CLOSE_TAB specified ID in the additionalParams
• objectID—the object ID of the
argument is closed. Or, fired when a primary
closed tab, if available
tab or subtab with no specified ID is closed.
Available in API version 30.0 or later.
5
Omni-Channel Developer Guide Omni-Channel Components for the Salesforce Console
Integration Toolkit
sforce.console.ConsoleEvent. Fired when a user changes • statusId—the ID of the agent’s current presence status.
PRESENCE.STATUS_CHANGED his or her presence status.
• channels—channelJSON string of channel objects.
Available in API version
• statusName—the name of the agent’s current presence
32.0 or later.
status.
• statusApiName—the API name of the agent’s current
presence status.
sforce.console.ConsoleEvent. Fired when a user is • workItemId—the ID of the object that’s routed through
PRESENCE.WORK_ASSIGNED assigned a new work item. Omni-Channel. This object becomes a work assignment with
Available in API version a workId when it’s assigned to an agent.
32.0 or later. • workId—the ID of a work assignment that’s routed to an
agent.
sforce.console.ConsoleEvent. Fired when a user accepts • workItemId—the ID of the object that’s routed through
PRESENCE.WORK_ACCEPTED a work assignment, or Omni-Channel. This object becomes a work assignment with
when a work assignment a workId when it’s assigned to an agent.
is automatically accepted.
• workId—the ID of a work assignment that’s routed to an
Available in API version agent.
32.0 or later.
sforce.console.ConsoleEvent. Fired when a user declines • workItemId—the ID of the object that’s routed through
PRESENCE.WORK_DECLINED a work assignment. Omni-Channel. This object becomes a work assignment with
Available in API version a workId when it’s assigned to an agent.
32.0 or later. • workId—the ID of a work assignment that’s routed to an
agent.
6
Omni-Channel Developer Guide Omni-Channel Components for the Salesforce Console
Integration Toolkit
channel
The channel object contains the following properties:
developerName String Retrieves the developer name of the the service channel that’s associated with the
channelId.
Method Description
addEventListener() Adds a listener for a custom event type or a standard event type when
the event is fired. This method adds a listener for custom event types in
API version 25.0 or later; it adds a listener for standard event types in API
version 30.0 or later.
fireEvent() Fires a custom event. This method is only available in API version 25.0
or later.
removeEventListener() Removes a listener for a custom event type or a standard event type.
This method removes a listener for custom event types in API version
25.0 or later; it removes a listener for standard event types in API version
30.0 or later.
7
Omni-Channel Developer Guide External Routing for Omni-Channel
Information is shared using Salesforce APIs and the APIs for your partner application using the following process.
1. Salesforce sends events using Salesforce Streaming APIs for the PendingServiceRouting object.
2. Partner application creates a session to authenticate.
3. Partner application queries Salesforce for work details, agent availability, and more.
4. Partner application determines the routing decision.
5. AgentWork is created and pushed to the specified agent in Salesforce.
8
Omni-Channel Developer Guide Integrate External Routing for Omni-Channel
SEE ALSO:
Create Routing Configurations for Your Queues
Create a Queue
9
Omni-Channel Developer Guide Expected Behavior for External Routing for Omni-Channel
10
Omni-Channel Developer Guide Expected Behavior for External Routing for Omni-Channel
4. The LiveChatTranscript is updated with the Status = In Progress and the Owner = second Agent.
5. To determine if the Transfer to Agent has occurred, check that the second AgentWork isn’t inserted into the same LiveChatTranscript
as the first AgentWork.
Important: We don’t recommend using both external routing and Omni-Channel queue-based routing in the same implementation.
If the same agent is in both queues, the agent’s capacity could be exceeded. We don't have control over an agent's capacity in
external routing. If you attempt this combination, there can be unknown issues.
11
Omni-Channel Developer Guide Troubleshooting External Routing for Omni-Channel
For more information, see Message Durability in the Streaming API Developer Guide.
12
INDEX
O
Omni-Channel 1, 3–4, 8–10, 12
13