Data Pass API
Data Pass API sends custom data to the agent regarding context, or about the user or their experience.
You should not directly instantiate the DataPassAPI class. Instead use init method with a block parameter, which returns an instance of DataPassAPI class.
DataPassBuilder
Builder instance is passed as an argument to the above init block. Use the builder instance to setup the parameter need to make this request.
Public Methods
You can use the following builder public method to add data pass property and value, those props and values are then send to Nuance Messaging Systems. Atleast one property and value are required.
Finally invoke DataPassAPI sendDataPass method to send data pass to agent.
-
-(void) add:NSString* key andValue:(NSString*) value
Data pass attribute name and value. You can invoke above method more than once for the same request.
DataPassAPI
Public Methods
-
-(void) sendDataPass:(void (^) (Response *success, Resposne *error))completionBlock
Send data pass message to agent. This method raises an exception if status of the current engagement is neither created or nor queued.
Response
Either success or error parameter of completionBlock receives an instance of this class based on the status of this request.
Public Properties
-
NSString* statusCode
statusCode property has one of the 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: User hasn't privileges to use api or to see requested site.
500: Server error.
let dataPass = DataPassAPI.init(block:{ (builder) in
builder?.add("Test", andValue:"value1");
});
datapass?.sendDataPass({ (success, error) in
if(error != nil) {
} else {
}
});