Agent Status API
The Agent Availability call determines the current agent availability status. This determination depends on currently active engagements, total agent “slots” (sum of available slots across all agents in the relevant agent group) and queue threshold (configured per agent group).
Do not directly instantiate the AgentStatusAPI class. Instead, use an init method, with a block parameter, to return an instance of AgentStatusAPI class.
AgentAvailabilityBuilder
Builder instance is passed as an argument to the above init block. Use the builder instance to setup the parameter needed to make this request.
Public Properties
Use the following builder public properties to setup the parameters needed to pass in this request to Nuance Messaging Systems:
-
NSString *siteID
Sets the SiteID, which is required to instantiate the AgentStatusAPI object.
-
NSString *businessUnitID
Sets the Business Unit ID to check agent availability and HOP availability.
-
NSString *agentGroupID(
Sets the agentGroupID, which is required for getting agent status.
-
long queueThreshold
The queue threshold value to check agent availability.
-
NSDictionary *agentAttributes
List of agent attributes used in the routing process. Format is: attribute1,value1;attribute2,value2;etc.
Finally, invoke the AgentStatusAPI getAgentAvailabilityStatus method to get the agent Availability status.
AgentStatusAPI
Public Methods
-
-(void) getAgentAvailabilityStatus:(void (^) (AgentStatusResponse *success, Resposne *error))completionBlock
Request the agent availability status for the given AgentGroupID and BusinessUnitID.
AgentStatusResponse
An instance of this class is passed as an argument to the completionBlock. This will be nil if there is an error in this request.
Public Properties
-
BOOL isAvailable
true or false : Based on request content and related program configuration and/or utilization; for example, is there an agent or queue slot available at the time of the request.
-
BOOL isInHOP
true or false : Hours of Operation is defined at the site or Agent Group level.
-
NSString *getStatus
"online" or "offline" or "busy" : Indicates whether there are active agents (online), agents logged in but none are active (busy), or no agents logged in (offline).
Response
Response object is passed to the completionBlock. This will be nil if there is no error in the request.
Public Methods
-
long statusCode
statusCode property will have one of the following values:
401: Chat cannot be created.
400: Request has incorrect parameters.
403: User does not have privileges to use the API or to see the requested site.
500: Server error.
let siteID = "your site id";
let businessUnitID = "your business Unit id";
let agentGroupID = "your agent group id";
let agentStatus = AgentStatusAPI.init(block:{ (builder) in
builder?.siteID = siteID;
builder?.businessUnitID = businessUnitID;
builder?.agentGroupID = agentGroupID;
});
agentStatus?,getAgentAvailabilityStatus({ (success, error) in
if(error != nil) {
} else {
}
})