The Agent API provides methods for getting or setting agent presence and channel availability.

The Agent API is provided within the sn_awa namespace.

Requires the following:
  • Advanced Work Assignment plugin (com.glide.awa)
  • Role: awa_integration_user or admin

Agent - get(String user_sys_id)

Gets an agent by sys_id.

Table 1. Parameters
Name Type Description
user_sys_id String The sys_id of the user listed in sys_user table.
Table 2. Returns
Type Description
Boolean True if the user exists, false otherwise.

Example

var agent = sn_awa.Agent.get("<user_sys_id>");
var presence  = agent.getPresence();

Agent – getPresence()

Gets the current presence state and channel availability of a provided agent.

Table 3. Parameters
Name Type Description
None
Table 4. Returns
Type Description
Object Presence state sys_id, presence state name, and channel information. Error message otherwise.

Example

var agent = sn_awa.Agent.get("<user_sys_id>");
        var presence  = agent.getPresence();

Agent – setPresence(Object setRequest)

Sets the state of a provided agent's presence and sets the agent's channel availability for that state.

Table 5. Parameters
Name Type Description
setRequest Object The setRequest.sys_id and setRequest.channels.
setRequest.sys_id String The presence_sys_id from the AWA Presence State [awa_presence_state] table.
setRequest.channels name/value pair Optional.
  • sys_id: Channel_sys_id from the awa_service_channel table.
  • available: Agent availability to receive work for this channel (true or false).
Table 6. Returns
Type Description
Boolean True if successful, false otherwise.

Example

var agent = sn_awa.Agent.get("<user_sys_id>");
var presence = agent.setPresence({
    sys_id: <presence_sys_id>,
    channels: [{
        sys_id: "<channel_sys_id>",
        available: true // or false
    }]
});