List categories inside a project version
  • 02 Feb 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light

List categories inside a project version

  • Dark
    Light

GET /projectversions/{id}/categories 

Gets the list of categories within the project version


Header

ParameterTypeDescription
api_tokenstringYou can get the REST API from Settings > Advanced > API tokens.

Route Parameters

ParameterRequiredTypeDescription
idYesstringThe ID of the project version


Sample Response

{
    "data": [
    {
        "id": "5a232ecc-8f46-4ea1-8fc1-60511349893a",
        "name": "Core",
        "project_version_id": "7ba483c0-0929-4bb6-aa43-04a2f4bb8893",
        "order": 1,
        "parent_category_id": null,
        "hidden": false,
        "articles": [
            {
                "id": "76022d7e-9fbc-413e-a3d1-52a3963fa054",
                "title": "Core Article",
                "public_version": 0,
                "latest_version": 1,
                "hidden": false,
                "status": 0,
                "order": 1,
                "slug": "core-article"
            },
        ],
        "child_categories": [
            {
                "id": "d2631561-0885-4a0e-a294-951fe393e9ea",
                "name": "Core Sub",
                "project_version_id": "7ba483c0-0929-4bb6-aa43-04a2f4bb8893",
                "order": 1,
                "parent_category_id": "5a232ecc-8f46-4ea1-8fc1-60511349893a",
                "hidden": false,
                "articles": [],
                "child_categories": [],
                "icon": null,
                "icon_type": 0
            }
        ],
        "icon": null,
        "icon_type": 0
    }
    ],
    "extension_data": null,
    "context": null,
    "success": true,
    "errors": [],
    "warnings": [],
    "information": []
}


Response Data

ParameterTypeDescription
idstringThe ID of the category
namestringName of the category
project_version_idstringThe ID of the project version where this category is located
ordernumberThe position the category inside the parent category
parent_category_idstringThe ID of the parent category ( null if top-level )
hiddenstringIndicates if the category is visible on the site ( If "false," all the child categories and articles will be hidden as well )
articlesobject[]The list of articles attached to this category
child_categoriesobject[]The list of categories attached to this category
iconstringUnicode representation of the icon or image URL

Response > articles

ParameterTypeDescription
idstringThe ID of the article
titlestringThe article title
public_versionnumberThe article version number(revision) that is currently published
latest_versionnumberThe latest version number of this article
hiddenbooleanIndicates if the article is visible on the site
statusenumeratedThe status of the article: 0 - Draft, 1 - InReview, 2 - Public, 3 - Published, 4 - Deleted
ordernumberThe position of the article inside the parent category

Was this article helpful?