Data Pass API
The purpose of the DataPassAPI is to send custom data to the agent about the context of the engagement or the customer's experience.
You should not directly instantiate the DataPassAPI class. Instead, use the DataPassBuilder builder class
DataPassBuilder
Create the Builder instance by calling the DataPassAPI.builder()
Public Methods
You can use the Builder public methods to add data pass properties and value. The properties and values are then sent to the Nuance Messaging System. At least one property and value are required to invoke the Builder instance build method.
To create a DataPassAPI object, you must invoke the Builder instance build method.
-
public DataPassBuilder add(String name, String value)
Data pass attribute name and value.
-
public DataPassBuilder setSuccessListener(OnSuccessListener<Response> sListener)
The OnSuccessListener.onResponse method is invoked upon a successfull request.
-
public DataPassBuilder setErrorListener(OnErrorListener fListener)
The OnErrorListener.onErrorResponse method is invoked if there is an error in the request.
-
public DataPassAPI build()
Instantiates and returns the DataPassAPI instance.
DataPassAPI
Public Methods
-
public void sendDataPassToAgent()
Sends a data pass message to the agent.
-
public static DataPassProps builder()
Instantiates and returns the DataPassBuilder object.
Response
An instance of the Response class is passed as an argument to the OnErrorListener.onErrorResponse or OnSuccessListener.onResponse methods based on the status of the 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.
DataPassAPI dataPass = DataPassAPI.builder().add("Test","tesing")
.add("Test1","testing1")
.build();
dataPass.sendDataPassToAgent();