# Retrieving entity questionnaire answers

If your flow contains a questionnaire or product and plan logic block using [flow-logic](https://manual.personr.co/api-documentation/flow-logic "mention"), use this endpoint to retrieve the answers inputted by the entity during the verification process.

***

## Retrieving questionnaire answers

<mark style="color:green;">`POST`</mark> `/api-entity-questionnaire`

Retrieve entity questionnaire, product, and plan selection answers.

| Name          | Value                 |
| ------------- | --------------------- |
| Content-Type  | `multipart/form-data` |
| Authorization | `Bearer YOUR_TOKEN`   |

**Body**

<table><thead><tr><th>Name</th><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>applicantId</code></td><td>string</td><td>Unique applicantId generated on entity creation <mark style="color:red;">(required)</mark></td></tr></tbody></table>

#### Request

{% tabs %}
{% tab title="cURL" %}

```sh
curl --location 'https://enterprise.personr.co/api/1.1/wf/api-entity-questionnaire' \
--form 'applicantId="4242424242424x424242424242424242"'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var axios = require('axios');
var FormData = require('form-data');
var data = new FormData();
data.append('applicantId', '4242424242424x424242424242424242');

var config = {
  method: 'post',
maxBodyLength: Infinity,
  url: 'https://enterprise.personr.co/api/1.1/wf/api-entity-questionnaire',
  headers: { 
    ...data.getHeaders()
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
var form = new FormData();
form.append("applicantId", "4242424242424x424242424242424242");

var settings = {
  "url": "https://enterprise.personr.co/api/1.1/wf/api-entity-questionnaire",
  "method": "POST",
  "timeout": 0,
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require "uri"
require "net/http"

url = URI("https://enterprise.personr.co/api/1.1/wf/api-entity-questionnaire")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['applicantId', '4242424242424x424242424242424242']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://enterprise.personr.co/api/1.1/wf/api-entity-questionnaire"

payload={'applicantId': '4242424242424x424242424242424242'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
```

{% endtab %}
{% endtabs %}

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "applicantId": "1726733114679x00000000000",
    "flow": "Example Flow",
    "sourceKey": "Example Source Key",
    "externalUserId": [
    "Example External User ID", 
    "Another External User ID"
    ],
    "selectedProducts": [
    "Product A"
    ],
    "selectedProductIds": [
    "ProductA-20394"
    ],
    "selectedPlans": [
    "Plan A"
    ],
    "selectedPlanIds": [
    "Plan A-20394"
    ],
    "questionnaire": [
        {
            "flowQuestion": "Example Question",
            "questionId": "1724124467705x000000000000",
            "internalQuestionId": "Example Internal Question ID",
            "flowAnswer": [
                "No",
                "Yes"
            ]
        },
        {
            "flowQuestion": "Another Example Question",
            "questionId": "1724124485940x00000000000",
            "internalQuestionId": "Example Internal Question ID",
            "flowAnswer": "Yes"
        }
    ]
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "statusCode": 400,
    "message": "Error: incorrect applicantId provided"
}
```

{% endtab %}
{% endtabs %}
