CloseEngagementAPI
The the CloseEngagementAPI call gives customers a way to close the current messaging session with the agent.
API method for sending customer close message is exposed from the NuanMessaging class. Get the instance of NuanMessaging by using the code shown here.
NuanMessaging nuanMessaging = NuanMessaging.getInstance();
Public Methods
-
public void closeEngagement(OnErrorListener error) throws IllegalStateException
Sends close message to agent. Error listener will be notified if there is an error while closing current engagement session.
Response
OnErrorListener.onErrorResponse method receives an instance of Response class.
Public Methods
-
public int getStatusCode()
getStatusCode method returns following values which denotes status of this request
400: Request has incorrect parameters.
401: There is no such chat on server, chat should be started anew
403: The user does not have sufficient privileges to use the API or to access the requested site.
500: Server error.
NuanMessaging nuanMessaging = NuanMessaging.getInstance();
try {
nuanMessaging.closeEngagement();
}catch(IllegalStateException e){
Log.e("Nuance Messaging", e.getMessage());
}