Skip to main content

AppTone Get Questionnaires List

questionnaires is an HTTP GET enpoint to retrieve a list of all available questionnaires by filter.

A call to advisors endpoint requires basic authentication. Please refer to Analyze Now Authentication 

Here is a sample Javascript code to fetch the questionnaires list

Install required libraries

npm install axios

And the actual code

46.png

Available filters for questionnaires endpoint

query - filter by the questionnaire name 

tags - filter by a list of search tags assigned to the questionnaire

languages - filter by supported languages

Response

The response is a list of questionnaires that matching the search criteria

47.png

Fields

name - The questionnaire name

language - The questionnaire language

description - The questionnaire description

apptoneQuestionnaireId - The questionnaire id

AppTone Send Questionnaire To Customer

sendToCustomer is an HTTP POST enpoint to start an asynchronus test interaction with a user.

The sendToCustomer process status reported though a webhook calls from AppTone service.

A call to sendToCustomer endpoint requires basic authentication. Please refer to Analyze Now Authentication 

Sample NodeJS for sendToCustomer

Install required libraries

npm install axios

And the actual code

48.png

Response Structure

Upon request reception, AppTone validate the request parameters. For a valid request AppTone will return a "reportId" identifier to be used when recieving asynchronous status updates.

For invalid parameter the response AppTone will return an error code and message which indicates the invalid param.

Sample response for a valid request

49.png

Sample response for a request with an invalid parameter

50.png

Once a valid request accepted on AppTone, it starts sending status update to the URL provided on "statusCallbackUrl" parameter.

Sample status callback data 

51.png

Params on status callback 

application: always "apptone". 

eventDate: Time of the event in GMT timezone

payload: contain the actual event data

payload/reportId: The reportId that was provided on the response for the sentToCustomer request

payload/status: The current analysis status

encrypted: true of "encryptionKey" parameter sent on the sentToCustomer request

Avaialble Statuses

pending - The test was sent to the customer

running - The customer is running the test. This status comes with "totalMessages" and "receivedMessages" params which indicates the running progress

analyzing - AppTone analyze the test

completed - The report is ready. the "analysis" data contains the analysis data

In case an error happen during the test run, a relevant error status will be sent

52.png

AppTone Cancel Test Run

cancel endpoint abort a test before its running completed

Install the required libraries

npm install axios

Actual code

53.png

In case the reportId does not exists, or was already cenceled, AppTone will respond with an HTTP 404 status

AppTone Download Report PDF

downloadPdf is an HTTP POST asynchronous enpoint to create and downalod the report in a PSF format.

The downloadPdf send process status report though a webhook calls from AppTone service.

A call to downloadPdf endpoint requires basic authentication. Please refer to Analyze Now Authentication 

 

Sample NodeJS code for downloadPdf

Install required libraries

npm install axios fs

 

And the actual code

54.png

Response Structure

Upon request reception, AppTone validate the request parameters. For a valid request AppTone will return a "reportId" identifier to be used when recieving asynchronous status updates.

For invalid parameter the response AppTone will return an error code and message which indicates the invalid param.

Sample response for a valid request

55.png

Sample response for a request with an invalid parameter

56.png

Once a valid request accepted on AppTone, it will send a status updates to the URL provided on "statusCallbackUrl" parameter.

Sample status callback data with report PDF

57.png

Params on status callback 

application: always "apptone". 

eventDate: Time of the event in GMT timezone

payload: contain the actual event data

payload/reportId: The reportId that was provided on the response for the sentToCustomer request

payload/contentTyp": always "application/pdf"

payload/data: The PDF file content in Base64 encoding

encrypted: true of "encryptionKey" parameter sent on the downloadPdf request

 

Errors callback

In case an error happen during the test run, a relevant error status will be sent

58.png