# 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](https://emlo.cloud/documentation/analyze-now-applications-authenticaiton)

Here is a sample Javascript code to fetch the questionnaires list

**Install required libraries**

```javascript
npm install axios
```

**And the actual code**

**[![46.png](https://docs.ado-tech.com/uploads/images/gallery/2025-03/scaled-1680-/8qSQHyit3w1Ubcc1-46.png)](https://docs.ado-tech.com/uploads/images/gallery/2025-03/8qSQHyit3w1Ubcc1-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](https://docs.ado-tech.com/uploads/images/gallery/2025-03/scaled-1680-/PoVkLZmqd3FifE47-47.png)](https://docs.ado-tech.com/uploads/images/gallery/2025-03/PoVkLZmqd3FifE47-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](https://emlo.cloud/documentation/analyze-now-applications-authenticaiton)

It is recommended to encrypt the callback payload data by passing an "encryptionKey" string value on the request. [Please read more](https://emlo.cloud/documentation/analyze-now-encrypted-response)

**Sample NodeJS for sendToCustomer**

**Install required libraries**

```javascript
npm install axios
```

**And the actual code**

**[![48.png](https://docs.ado-tech.com/uploads/images/gallery/2025-03/scaled-1680-/ku1nK3fTIdNCmIbr-48.png)](https://docs.ado-tech.com/uploads/images/gallery/2025-03/ku1nK3fTIdNCmIbr-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](https://docs.ado-tech.com/uploads/images/gallery/2025-03/scaled-1680-/b0PK7zQ8vJxZfQA5-49.png)](https://docs.ado-tech.com/uploads/images/gallery/2025-03/b0PK7zQ8vJxZfQA5-49.png)**

**Sample response for a request with an invalid parameter**

**[![50.png](https://docs.ado-tech.com/uploads/images/gallery/2025-03/scaled-1680-/PxnD0gSinaNw9XMT-50.png)](https://docs.ado-tech.com/uploads/images/gallery/2025-03/PxnD0gSinaNw9XMT-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](https://docs.ado-tech.com/uploads/images/gallery/2025-03/scaled-1680-/xOpKZhoj70Pe4aDv-51.png)](https://docs.ado-tech.com/uploads/images/gallery/2025-03/xOpKZhoj70Pe4aDv-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](https://docs.ado-tech.com/uploads/images/gallery/2025-03/scaled-1680-/Og3eg6dD1m3QDIZy-52.png)](https://docs.ado-tech.com/uploads/images/gallery/2025-03/Og3eg6dD1m3QDIZy-52.png)**

AppTone Cancel Test Run

**cancel** endpoint abort a test before its running completed

**Install the required libraries**

```javascript
npm install axios
```

**Actual code**

**[![53.png](https://docs.ado-tech.com/uploads/images/gallery/2025-03/scaled-1680-/7lAZqhEvB56t50aF-53.png)](https://docs.ado-tech.com/uploads/images/gallery/2025-03/7lAZqhEvB56t50aF-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](https://emlo.cloud/documentation/analyze-now-applications-authenticaiton)

It is recommended to encrypt the callback payload data by passing an "encryptionKey" string value on the request. [Read more](https://emlo.cloud/documentation/analyze-now-encrypted-response)

Sample NodeJS code for downloadPdf

**Install required libraries**

```javascript
npm install axios fs
```

**And the actual code**

**[![54.png](https://docs.ado-tech.com/uploads/images/gallery/2025-03/scaled-1680-/CcGRXX3bbF0TNk3P-54.png)](https://docs.ado-tech.com/uploads/images/gallery/2025-03/CcGRXX3bbF0TNk3P-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](https://docs.ado-tech.com/uploads/images/gallery/2025-03/scaled-1680-/FLPkCRnGKa5Y2AWV-55.png)](https://docs.ado-tech.com/uploads/images/gallery/2025-03/FLPkCRnGKa5Y2AWV-55.png)**

**Sample response for a request with an invalid parameter**

**[![56.png](https://docs.ado-tech.com/uploads/images/gallery/2025-03/scaled-1680-/5DJUU7qRBKejDi3C-56.png)](https://docs.ado-tech.com/uploads/images/gallery/2025-03/5DJUU7qRBKejDi3C-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](https://docs.ado-tech.com/uploads/images/gallery/2025-03/scaled-1680-/iya9FpK2y5ZBwfzJ-57.png)](https://docs.ado-tech.com/uploads/images/gallery/2025-03/iya9FpK2y5ZBwfzJ-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](https://docs.ado-tech.com/uploads/images/gallery/2025-03/scaled-1680-/0vn5ovm89gzdvEVf-58.png)](https://docs.ado-tech.com/uploads/images/gallery/2025-03/0vn5ovm89gzdvEVf-58.png)