Omni Toolkit API
lightning:omniToolkitAPI
Work with the Omni-channel toolkit.
For Use In
Lightning Experience
The lightning:omniToolkitAPI component enables a component in the utility bar for Omni-Channel to use methods like returning a list of open work items for an agent. Omni-Channel routes work to agents in the console.
This example includes a button to accept a work item that’s assigned to an agent in the Omni-Channel utility.
The button in the component calls the following client-side controller.
This component supports the following methods. For more information on these methods, see the Omni-Channel Developer Guide.
acceptAgentWork({workId}): Accepts a work item that’s assigned to an agent.
workId(string): The ID of the work item the agent accepts.
Returns a Promise. Success resolves to true. The Promise is rejected on error.
closeAgentWork({workId}): Changes the status of a work item to Closed and removes it from the list of work items.
workId(string): The ID of the work item that’s closed.
Returns a Promise. Success resolves to true. The Promise is rejected on error.
declineAgentWork({workId, declineReason}): Declines a work item that’s assigned to an agent.
workId(string): The ID of the work item that the agent declines.declineReason(string): Optional. The provided reason for why the agent declined the work request.
Returns a Promise. Success resolves to true. The Promise is rejected on error.
getAgentWorks(): Returns a list of work items that are currently assigned to an agent and open in the agent’s workspace.
Returns a Promise. Success resolves to an array of work objects. The Promise is rejected on error.
getAgentWorkload(): Retrieves an agent’s currently-assigned workload. Use this method for rerouting work to available agents.
Returns a Promise. Success resolves to configuredCapacity, currentWorkload, configuredInterruptibleCapacity and currentInterruptibleWorkload properties. The Promise is rejected on error.
getServicePresenceStatusChannels(): Retrieves the service channels that are associated with an Omni-Channel user’s current presence status.
Returns a Promise. Success resolves to an array of channel objects. The Promise is rejected on error.
getServicePresenceStatusId(): Retrieves an agent’s current presence status.
Returns a Promise. Success resolves to statusName, statusApiName and statusId properties. The Promise is rejected on error.
login({statusId}): Logs an agent into Omni-Channel with a specific presence status.
statusId(string): The ID of the presence status.
Returns a Promise. Success resolves to true. The Promise is rejected on error.
logout(): Logs an agent out of Omni-Channel.
Returns a Promise. Success resolves to true. The Promise is rejected on error.
setServicePresenceStatus({statusId}): Sets an agent’s presence status to a status with a particular ID. We log the user into presence if that user isn’t already logged in. This removes the need for you to make additional calls.
statusId(string): The ID of the presence status you want to set the agent to.
Returns a Promise. Success resolves to statusName, statusApiName, statusId properties and an array of channel objects. The Promise is rejected on error.
raiseAgentWorkFlag({workId, message}): Raises a flag for this agent work item.
workId(string): The ID of the work item to raise the flag on.message(string): Optional. The message associated with this flag.
Returns a Promise. Success resolves to true. The Promise is rejected on error.
lowerAgentWorkFlag({workId}): Lowers a flag for this agent work item.
workId(string): The ID of the work item to lower the flag on.
Returns a Promise. Success resolves to true. The Promise is rejected on error.