Value Lists API
In order to create a value list you first have to create all the values that you want to add to the list as described here: Add Values to Key, and you have to have the id of the key that you want to add the values to.
Creating a Value List
SDK
Use tab completion with SDK to auto-complete function names or show field options!
n/aREST API
POST /api/v0/value_lists
Headers
Content-Type application/json
Authorization "yourAuthToken"Body (example)
|
Required parameters: name, key_id (the id of the key you want to add the values to)
Response
Status code 200
{
"id": 321,
"name": "my_value_list",
"description": null,
"account_id": 391,
"key_id": 456,
"free_values": [],
"value_ids": [51643,
51644,
51645
],
"created_at": "2019-07-12T16:49:50.754Z"
}Get a Value List
SDK
n/aREST API
GET /api/v0/value_lists/<id>
Headers
Content-Type application/json
Authorization "yourAuthToken"Response
Status code 200
{
"id": 321,
"name": "my_value_list",
"description": "",
"account_id": 391,
"key_id": 456,
"free_values": [],
"value_ids": [
51643,
51644,
51645
],
"created_at": "2019-04-30T15:26:00.605Z"
}If you want to add new values to the list you have to replace all the values in the list.