Customer Message API
The purpose of the Customer Message API call is to send a new message from the customer to the agent.
The API method for sending the customer message is exposed from the NuanMessaging class. You must get the instance of the NuanMessaging class.
NuanMessaging nuanMessaging = NuanMessaging.getInstance();
Public Methods
To send a customer message to an agent, use the public methods shown here from the NuanMessaging Class.
-
public void sendCustomerText(String text, OnSuccessListener<Response> listener,OnErrorListener error)
Sends a customer message to the agent. You can also pass the optional success and error listener. Based on the resonse status, either Success or Error listener is invoked with the respective status of this request.
-
public void sendCustomerText(String text)n
Sends the customer message to the agent.
Response
An instance of the Response class is passed as an argument to OnErrorListener.onErrorResponse or OnSuccessListener.onResponse based on the status of this request.
Public Methods
-
public int getStatusCode()
getStatusCode method returns following values which denotes the status of this request.
200: Message was accepted by server
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.
String message = "customer message";
NuanMessaging nuanMessaging = NuanMessaging.getInstance();
nuanMessaging.sendCustomerText(message);