Document Categories

Get a Category with all Information

Required scope: public-api:read

Description

You need to activate the Categories / Routing feature in the Project Config in order to query categories.
Curl Example
ACCESS_TOKEN=ey1234
curl -k -X GET "https://server.livingdocs.io/api/v1/categories/:categoryId" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Endpoint

GET api/v1/categories/:categoryId

Parameters

NameTypeRequiredNotes
:categoryIdstringxId of a specific categories as fetched from the /categories endpoint.
?inheritMetadatabooleanIf set to “true” will inherit (but not overwrite) metadata properties from all parents Inheritance depth is limited to 20.

Response

200
OK
api/v1/categories/123abc
{
  "id": "123abc",
  "label": "Sport",
  "path": "/sport",
  "metadata": {
    "adId": "sport-ads",
    "analyticsCode": "sport-analytics"
  }
}
400
Bad Request
api/v1/categories/123abc
{
  "status": 400,
  "error": "Bad Request",
  "error_details": {
    "message": "Use of the category API requires a configurable channel. The project you requested uses a static configuration though."
  }
}
500
Bad Request
api/v1/categories/123abc?inheritMetadata=true
{
  "status": 500,
  "error": "Bad Request",
  "error_details": {
    "message": "Inheritance queries can only be made up to a depth of 20."
  }
}

Get Categories for a Project

Required scope: public-api:read

Description

You need to activate the Categories / Routing Feature in the Project Config in order to query categories.
Curl Example
ACCESS_TOKEN=ey1234
curl -k -X GET "https://server.livingdocs.io/api/v1/categories" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Endpoint

GET api/v1/categories

Response

200
OK
api/v1/categories
[
  {
    "id": "category-id-1",
    "label": "Category 1",
    "path": "/category1"
  },
  {
    "id": "category-id-2",
    "label": "Category 2",
    "path": "/category2",
    "parent": "category-id-1"
  },
  {
    "id": "category-id-3",
    "label": "Category 3",
    "path": "/category3"
  }
]
400
Bad Request
api/v1/categories
{
  "status": 400,
  "error": "Bad Request",
  "error_details": {
    "message": "Use of the category API requires a configurable channel. The project you requested uses a static configuration though."
  }
}