Skip to main content
Skip table of contents

Valuelists

Contents

Valuelists hold lists of predefined values and their user-friendly titles associated with some document fields, e.g. statuses, names in singular and plural forms etc. See ValuesList document model for more details.

List Valuelists

List all Valuelists.

Endpoint:

URL

/api/v2/valuelists/

Method

GET

Expected response code

200

Expected response type

JSON

Example:

BASH
curl -v \
    -H "Authorization: apikey $API_USER:$API_KEY" \
    $COREDATA_BASE_URL/api/v2/valuelists/

Example response:

Valuelist list JSON
JSON
{
    "meta": {
        "limit": 50,
        "next": null,
        "offset": 0,
        "previous": null,
        "total_count": 47
    },
    "objects": [
        {
            "default": null,
            "name": "task_status",
            "parent": null,
            "resource_uri": "/api/v2/valuelists/task_status/",
            "type": "status"
        },
        {
            "default": null,
            "name": "project_status",
            "parent": null,
            "resource_uri": "/api/v2/valuelists/project_status/",
            "type": "status"
        },
        {
            "default": null,
            "name": "contact_status",
            "parent": null,
            "resource_uri": "/api/v2/valuelists/contact_status/",
            "type": "status"
        },
        {
            "default": null,
            "name": "profession_category",
            "parent": null,
            "resource_uri": "/api/v2/valuelists/profession_category/",
            "type": "value"
        },
        {
            "default": null,
            "name": "contact_group",
            "parent": null,
            "resource_uri": "/api/v2/valuelists/contact_group/",
            "type": "value"
        },
        // ...
    ]
}

Get Valuelist details

Get details of an existing Valuelist.

Endpoint:

URL

/api/v2/valuelists/$valuelist_name/

Method

GET

Expected response code

200

Expected response type

JSON

URL parameters:

  • valuelist_name – name of an existing Valuelist.

Example:

BASH
valuelist_name=project_status

curl -v \
    -H "Authorization: apikey $API_USER:$API_KEY" \
    $COREDATA_BASE_URL/api/v2/valuelists/$valuelist_name/

Example response:

Valuelist details JSON
JSON
{
    "default": null,
    "entries": [
        {
            "name": "project_status:Pending:",
            "ordering": 10000000,
            "parent": null,
            "translations": {
                "en": "Pending",
                "is": "Skráð"
            }
        },
        {
            "name": "project_status:In_progress:",
            "ordering": 10000000,
            "parent": null,
            "translations": {
                "en": "In progress",
                "is": "Í vinnslu"
            }
        },
        {
            "name": "project_status:On_hold:",
            "ordering": 10000000,
            "parent": null,
            "translations": {
                "en": "On hold",
                "is": "Í bið"
            }
        },
        {
            "name": "project_status:Closed:",
            "ordering": 10000000,
            "parent": null,
            "translations": {
                "en": "Closed",
                "is": "Lokið"
            }
        }
    ],
    "id": null,
    "name": "project_status",
    "parent": null,
    "resource_uri": "/api/v2/valuelists/project_status/",
    "type": "status"
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.