Get category with an ID
  • 09 Mar 2023
  • 4 Minutes to read
  • Contributors
  • Dark
    Light

Get category with an ID

  • Dark
    Light

Get
/v1/Categories/{categoryId}

Security
API Key
Header parameter nameapi_token
Enter REST API key. To generate a key, go to Settings → Knowledge base portal → API tokens
Path parameters
categoryId
string Required

The ID of the category

Responses
200

Success

Success Response

This is an example for get category succes response. \n Here you can view diffrent data included with multiple article associated with a category.

{
  "data": {
    "id": "5b291e6b-fa40-4ab9-941e-f8fffc23b376",
    "name": "Category Name",
    "project_version_id": "46f48bc7-760f-4b07-b2d2-fce4aa8ba234",
    "order": 11,
    "parent_category_id": null,
    "hidden": false,
    "articles": [
      {
        "id": "cf8f67da-77c7-48b1-b207-70875caa2f55",
        "title": "New article 1",
        "public_version": 1,
        "latest_version": 1,
        "language_code": null,
        "hidden": false,
        "status": 2,
        "order": 2,
        "slug": "new-article-1",
        "content_type": null
      },
      {
        "id": "925b69b9-f241-4d89-9e3e-208a98dfc8eb",
        "title": "New article 2",
        "public_version": 1,
        "latest_version": 1,
        "language_code": null,
        "hidden": false,
        "status": 2,
        "order": 2,
        "slug": "new-article-2",
        "content_type": null
      }
    ],
    "child_categories": [],
    "icon": null,
    "slug": "category-name",
    "language_code": null,
    "category_type": 2,
    "created_at": "2023-03-08T10:40:05.3642004Z",
    "modified_at": "2023-03-08T10:40:05.3642022Z"
  },
  "extension_data": null,
  "success": true,
  "errors": [],
  "warnings": [],
  "information": []
}
Expand All

object

data
object

id
string 

The ID of the category


name
string 

Name of the category


project_version_id
string 

The ID of the project version where this category is located


order
integer 

The position the category inside the parent category


parent_category_id
string 

The ID of the parent category ( null if top-level )


hidden
boolean 

Indicates if the category is visible on the site ( If "false," all the child categories and articles will be hidden as well )


articles
Array of object

The list of articles attached to this category


object

id
string 

The ID of the article


title
string 

The article title


public_version
integer 

The article version number(revision) that is currently published


latest_version
integer 

The latest version number of this article


language_code
string 


hidden
boolean 

Indicates if the article is visible on the site


status
integer 

Valid values[0,1,2,3,4,5]
order
integer 

The position of the article inside the parent category


slug
string 


content_type
integer 

Valid values[0,1,2]
child_categories
Array of object

The list of categories attached to this category


object

id
string 

The ID of the category


name
string 

Name of the category


project_version_id
string 

The ID of the project version where this category is located


order
integer 

The position the category inside the parent category


parent_category_id
string 

The ID of the parent category ( null if top-level )


hidden
boolean 

Indicates if the category is visible on the site ( If "false," all the child categories and articles will be hidden as well )


articles
Array

The list of articles attached to this category


child_categories
Array

The list of categories attached to this category


icon
string 

Unicode representation of the icon or image URL


slug
string 

The slug of the category


language_code
string 


category_type
integer 

Valid values[0,1,2]
created_at
string 

Category created date time


modified_at
string 

Category modified date time


icon
string 

Unicode representation of the icon or image URL


slug
string 

The slug of the category


language_code
string 


category_type
integer 

Valid values[0,1,2]
created_at
string 

Category created date time


modified_at
string 

Category modified date time


extension_data
object


success
boolean 

Status indication for customer Api response


errors
Array of object

Errors in the customer Api response


object

extension_data
 

stack_trace
string 

Stack trace for error response message


description
string 

Description for error cause


error_code
string 

Error code for Api resonse


custom_data
object


warnings
Array of object

Warning in the customer Api response


object

extension_data
 

description
string 

Warning description


warning_code
string 

warning code for customer Api base response


information
Array of object

Information passed by the customer Api response


object

extension_data
 

description
string 

status description for customer Api response information


400

Bad Request

Category Not Found

Kindly verify the Categotry Id, and peroform the task again.

{
  "data": null,
  "extension_data": null,
  "success": false,
  "errors": [
    {
      "extension_data": null,
      "stack_trace": null,
      "description": "Cannot find category with id 5b291e6b-fa40-4ab9-941e-f8fffc23b3761",
      "error_code": "400",
      "custom_data": null
    }
  ],
  "warnings": [],
  "information": []
}
Expand All

object

data
object

id
string 

The ID of the category


name
string 

Name of the category


project_version_id
string 

The ID of the project version where this category is located


order
integer 

The position the category inside the parent category


parent_category_id
string 

The ID of the parent category ( null if top-level )


hidden
boolean 

Indicates if the category is visible on the site ( If "false," all the child categories and articles will be hidden as well )


articles
Array of object

The list of articles attached to this category


object

id
string 

The ID of the article


title
string 

The article title


public_version
integer 

The article version number(revision) that is currently published


latest_version
integer 

The latest version number of this article


language_code
string 


hidden
boolean 

Indicates if the article is visible on the site


status
integer 

Valid values[0,1,2,3,4,5]
order
integer 

The position of the article inside the parent category


slug
string 


content_type
integer 

Valid values[0,1,2]
child_categories
Array of object

The list of categories attached to this category


object

id
string 

The ID of the category


name
string 

Name of the category


project_version_id
string 

The ID of the project version where this category is located


order
integer 

The position the category inside the parent category


parent_category_id
string 

The ID of the parent category ( null if top-level )


hidden
boolean 

Indicates if the category is visible on the site ( If "false," all the child categories and articles will be hidden as well )


articles
Array

The list of articles attached to this category


child_categories
Array

The list of categories attached to this category


icon
string 

Unicode representation of the icon or image URL


slug
string 

The slug of the category


language_code
string 


category_type
integer 

Valid values[0,1,2]
created_at
string 

Category created date time


modified_at
string 

Category modified date time


icon
string 

Unicode representation of the icon or image URL


slug
string 

The slug of the category


language_code
string 


category_type
integer 

Valid values[0,1,2]
created_at
string 

Category created date time


modified_at
string 

Category modified date time


extension_data
object


success
boolean 

Status indication for customer Api response


errors
Array of object

Errors in the customer Api response


object

extension_data
 

stack_trace
string 

Stack trace for error response message


description
string 

Description for error cause


error_code
string 

Error code for Api resonse


custom_data
object


warnings
Array of object

Warning in the customer Api response


object

extension_data
 

description
string 

Warning description


warning_code
string 

warning code for customer Api base response


information
Array of object

Information passed by the customer Api response


object

extension_data
 

description
string 

status description for customer Api response information



Was this article helpful?