v1

latestOpenAPI 3.0.0Open Government Licence v3.02026-07-2391313.3 KB
Private

Create a code list

Create a codelist for an instance in recipe and add to mongo

post/recipes/{recipe_id}/instances/{dataset_id}/code-lists

Path parameters

recipe_idstring required

A unique id for a recipe

dataset_idstring required

An id for an instance in the recipe

Request body

idstring

A unique id for a single code list

namestring

The name of the codelist

hrefstring

A URL to the code list

is_hierarchyboolean

A bool to inform if there is hierarchy for codelist

Example request

{
  "id": "e44de4c4-d39e-4e2f-942b-3ca10584d078",
  "name": "calendar-years",
  "href": "http://localhost:22300/code-lists/e44de4c4-d39e-4e2f-942b-3ca10584d0782"
}

Response

A json object of specific recipe with new added code list in specific instance

idstring

A unique id for the recipe

aliasstring

An alias for the recipe

format'v4' | 'cantabular_blob' | 'cantabular_table'

The recipe format

cantabular_blobstring

A Cantabular-specific collection of data

Example response

{
  "id": "b944be78-f56d-409b-9ebd-ab2b77ffe187",
  "alias": "CPI COICOP",
  "files": [
    {
      "description": "CPI COICOP v4"
    }
  ],
  "output_instances": [
    {
      "dataset_id": "931a8a2a-0dc8-42b6-a884-7b6054ed3b68",
      "editions": [
        "Time-series"
      ],
      "title": "UK consumer price inflation",
      "code_lists": [
        {
          "id": "e44de4c4-d39e-4e2f-942b-3ca10584d078",
          "name": "calendar-years",
          "href": "http://localhost:22300/code-lists/e44de4c4-d39e-4e2f-942b-3ca10584d0782"
        }
      ]
    }
  ],
  "cantabular_blob": "People"
}