setServicePresenceStatus

Sets an agent’s presence status to a status with a particular ID. In API version 35.0 and later, we log the user into presence if that user is not already logged in, so you don’t have to make additional calls. You also can use this method to reconnect to Omni-Channel after a connection error.

NameTypeDescription
statusIdStringThe ID of the presence status you want to set the agent to. Agents must be given access to this presence status through their associated profile or permission set.
callbackfunctionJavaScript method to call when the agent’s status is changed to the presence status associated with statusId.

This method is asynchronous so it returns its response in an object in a callback method. The response object contains the following properties:

NameTypeDescription
successBooleantrue if setting the agent’s status was successful; false if setting the agent’s status wasn’t successful.
statusNameStringThe name of the agent’s current presence status.
statusApiNameStringThe API name of the agent’s current presence status.
statusIdStringThe ID of the agent’s current presence status.
channelsJSON string of channel objectsReturns the IDs and API names of the channels associated with the presence status.