Survey URL API
The purpose of the Survey URL API is to provide clients with a way to launch a post chat survey. API returns a URL which must be opened in an external browser or in a Webview.
SDK also provides an easy way of retrieving survey URL if agent closes the engagement session before the user initiates the close. NuanMessaging.getInstance().surveyUrl, This retrieves the url only when agent closes the engagement session. Application has to use the SurveyURLAPI when user initiates the close.
Public Methods
-
-(void) getSurveyData:(void (^) (SurveyUrlResponse *success, Resposne *error))completionBlock
Retrieves Survey URL for this active engagement. This method raises an exception if status of the current engagement is neither created or nor queued.
SurveyUrlResponse
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
-
NSStrings *surveyUrl
Returns survey url.
-
NSStrings *surveyLaunchData
Returns survey launch data. Launch Data must be appended to the URL as queryparameters.
Response
Response object is passed to the completionBlock. This will be nil if there is no error in this request.
Public Methods
-
long statusCode
statusCode property will have one of the following values.
401: Chat can not be created
400: Request has incorrect parameters
403: User hasn't privileges to use api or to see requested site
500: Server error
let survey = SurveyURLAPI();
survey.getSurveyData({ (success, error) in
if(error != nil) {
} else {
}
});