# JSON / REST API Lists

The JSON data / REST answer type allows you create a list based on a remote HTTP endpoint returning JSON formatted object.&#x20;

The format of the returned JSON must an array of objects with name and value properties as shown in the short sample below.

```
  [
    {
        "name": "Alabama",
        "value": "AL"
    },
    {
        "name": "Alaska",
        "value": "AK"
    },
    {
        "name": "American Samoa",
        "value": "AS"
    },
  ]
```

{% hint style="info" %}
The name being the text displayed to the respondent in the list and the value being the actual value saved with the respondent answers.
{% endhint %}

## 🔅 JSON lists properties

* **`Type name`** display name of the list.
* **`Layout`** defines how the list will be rendered either as a dropdown list or as autocomplete field that will filter the list based on the respondent entry.
* **`JSON Data url`** http url of the endpoint returning the JSON list array eg: <http://yourrestapiserver/jsonfile.json> &#x20;
* **`Database connection string`** [connection string](https://connectionstrings.com/sql-server/) to your SQL Server database.
* **`SQL query`** Actual query that will be execute to retrieve the list items. You may also add [parameters](https://docs.ngsurvey.com/form-management/form-designer/answers/answer-types/creating-new-type/lists/sql-server-lists/sql-parameters) to generate dynamic queries.
