Agent Status API
The purpose of the Agent Availability call is to determine the availability status of the agent. This value depends on the number of currently active engagements, the total number of agent slots in the queue, and the queue threshold value. (Agent slots equal the number of agents available in the relevant agent groups. Queue threshold is configured per agent group.)
You should not directly instantiate the AgentStatusAPI class. Instead use the AgentStatsuAPI builder class
Agent Availability Builder
Create a builder instance by calling AgentStatusAPI.builder()
Public Methods
Use the following public builder methods to setup the parameters needed to pass the request to the Nuance Messaging Systems. You cannot invoke a builder instance method until you call all of the required fields.
Invoke the Builder instance build method to create an AgentStatusAPI object.
-
public BusinessUnitID siteID(String siteID)
Sets the site ID which is required to instantiate the AgentStatusAPI object.
-
public AgentGroupID businessUnitID(String buID)
Sets the business unit ID to check agent availability and HOP availability.
-
public AgentAvailabilityBuilder agentGroupID(String agID)
Sets the agentGroupID which is required for getting agent status.
-
public EngagementBuilder queueThreshold(long qThreshold)
The queue threshold value is used to check agent availability.
-
public AgentAvailabilityBuilder agentAttributes(HashMap<String, String> aAttributes)
A list of agent attributes used in the routing process. Use the format: attribute1,value1;attribute2,value2 etc.
-
public AgentAvailabilityBuilder setSuccessListener(OnSuccessListener<AgentStatusResponse> sListener)
The OnSuccessListener.onResponse method is invoked upon a successfull request.
-
public AgentAvailabilityBuilder setErrorListener(OnErrorListener fListener)
OnErrorListener.onErrorResponse method is invoked if there is an error in the request.
-
public AgentStatusAPI build()
Instantiates and returns the AgentStatusAPI instance.
AgentStatusAPI
Public Methods
-
public void getAgentAvailabilityStatus()
Requests the agent availability status for the given agent group ID and business unit ID.
-
public static SiteID builder()
Instantiates and returns the AgentAvailabilityBuilder object.
AgentStatusResponse
An instance of this class is passed as an argument to the successListener.
Public Methods
-
public boolean isAvailable()
Availability is based on the request content and related program configuration and utilization. Is there an agent or queue slot available at the time of the request. Return values are true or false.
-
public boolean isInHOP()
Hours of operation are defined at the site or agent group level. Return values are true or false.
-
public String getStatus()
This call gets current agent status. Values are Constant.ONLINE, Constant.OFFLINE, and Constant.BUZY : When agents are active, status is online. When agents are logged in but not active, status is busy. When no agents are logged in, status is offline.
Response
Response object is passed to the OnErrorListener.onErrorResponse
Public Methods
-
public int getStatusCode()
getStatusCode method returns following values which denotes the status of this request.
400: Request has incorrect parameters.
403: The user does not have sufficient privileges to use the API or to access the requested site.
500: Server error.
String siteID = "your site id";
String businessUnitID = "your business Unit id";
String agentGroupID = "your agent group id";
AgentStatusAPI agentAvailability = AgentStatusAPI.builder().siteID(siteID).businessUnitID(businessUnitID).agentGroupID(agentGroupID)
.setSuccessListener(new OnSuccessListener<AgentStatusResponse>() {
@Override
public void onResponse(AgentStatusResponse response) {
}
})
.setErrorListener(new OnErrorListener() {
@Override
public void onErrorResponse(Response response) {
}
})
.build();
agentAvailability.getAgentAvailabilityStatus();