Category
  • 16 Jun 2022
  • 2 Minutes to read
  • Dark
    Light

Category

  • Dark
    Light

Article summary

Category

You need the Manage articles permission to manage categorys.

Category JSON Format

Category is represented as simple flat JSON objects with the following keys:

NameTypeDescription
idguidId of the category.
kbIdguidId of the knowledage base.
namestringName of the category.
orderintegerOrder of the category.
parentIdguidId of the parent category.
createdByIdguidId of the agent who created the category.
createdTimedatetimeTime when the category was created.
modifiedByIdguidId of the agent who modified the category.
modifiedTimetimestampTime when the category was last modified.

Get the list of Categories

GET kb/categories

  • Parameters:

NameTypeinRequiredDescription
keywordsstringquerynoSearch keywords.
kbIdguidquerynoId of the knowledage base.
  • Response:

An array of Category

  • Example

Sample Request:

curl https://api11.comm100.io/v4/kb/categories \ 
    -X 'GET' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 200 OK

[
  {
      "id": "8a21934a-7def-4064-a211-3cc5295282f9",
      "kbId": "b2754e68-b380-4a61-9c5b-a9570f1a4fcc",
      "name": "Support",
      "order": 8,
      "parentId": "8a21934a-7def-4064-a211-3cc5295282f9",
      "createdById": "21b5d834-b98b-48ba-ae45-0d1316cb382f",
      "createdTime": "2021-04-09T10:38:47.223Z",
      "modifiedById": "21b5d834-b98b-48ba-ae45-0d1316cb382f",
      "modifiedTime": "2021-04-09T10:38:47.223Z"
  }
] 

Get a single Category

GET kb/categories/{id}

  • Parameters:

No Parameters

  • Response:

Category

  • Example

Sample Request:

curl https://api11.comm100.io/v4/kb/categories/8a21934a-7def-4064-a211-3cc5295282f9 \ 
    -X 'GET' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 200 OK

{
  "id": "8a21934a-7def-4064-a211-3cc5295282f9",
  "kbId": "b2754e68-b380-4a61-9c5b-a9570f1a4fcc",
  "name": "Support",
  "order": 8,
  "parentId": "8a21934a-7def-4064-a211-3cc5295282f9",
  "createdById": "21b5d834-b98b-48ba-ae45-0d1316cb382f",
  "createdTime": "2021-04-09T10:38:47.223Z",
  "modifiedById": "21b5d834-b98b-48ba-ae45-0d1316cb382f",
  "modifiedTime": "2021-04-09T10:38:47.223Z"
} 

Create a new Category

POST kb/categories

  • Parameters:

NameTypeinRequiredDescription
kbIdguidbodyyesId of the knowledage base.
namestringbodyyesName of the category.
orderintegerbodynoOrder of the category.
parentIdguidbodyyesId of the parent category.
  • Response:

Category

  • Example

Sample Request:

curl https://api11.comm100.io/v4/kb/categories \ 
    -X 'POST' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 
    -D '{"kbId":"b2754e68-b380-4a61-9c5b-a9570f1a4fcc","name":"Support","order":8,"parentId":"8a21934a-7def-4064-a211-3cc5295282f9"}' 

Response:

HTTP/1.1 201 Created

{
  "id": "8a21934a-7def-4064-a211-3cc5295282f9",
  "kbId": "b2754e68-b380-4a61-9c5b-a9570f1a4fcc",
  "name": "Support",
  "order": 8,
  "parentId": "8a21934a-7def-4064-a211-3cc5295282f9",
  "createdById": "21b5d834-b98b-48ba-ae45-0d1316cb382f",
  "createdTime": "2021-04-09T10:38:47.223Z",
  "modifiedById": "21b5d834-b98b-48ba-ae45-0d1316cb382f",
  "modifiedTime": "2021-04-09T10:38:47.223Z"
} 

Update the Category

PUT kb/categories/{id}

  • Parameters:

NameTypeinRequiredDescription
namestringbodyyesName of the category.
orderintegerbodynoOrder of the category.
parentIdguidbodyyesId of the parent category.
  • Response:

Category

  • Example

Sample Request:

curl https://api11.comm100.io/v4/kb/categories/8a21934a-7def-4064-a211-3cc5295282f9 \ 
    -X 'PUT' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 
    -D '{"name":"Support","order":8,"parentId":"8a21934a-7def-4064-a211-3cc5295282f9"}' 

Response:

HTTP/1.1 200 OK

{
  "id": "8a21934a-7def-4064-a211-3cc5295282f9",
  "kbId": "b2754e68-b380-4a61-9c5b-a9570f1a4fcc",
  "name": "Support",
  "order": 8,
  "parentId": "8a21934a-7def-4064-a211-3cc5295282f9",
  "createdById": "21b5d834-b98b-48ba-ae45-0d1316cb382f",
  "createdTime": "2021-04-09T10:38:47.223Z",
  "modifiedById": "21b5d834-b98b-48ba-ae45-0d1316cb382f",
  "modifiedTime": "2021-04-09T10:38:47.223Z"
} 

Remove the Category

DELETE kb/categories/{id}

  • Parameters:

No Parameters

  • Response:

No Content

  • Example

Sample Request:

curl https://api11.comm100.io/v4/kb/categories/8a21934a-7def-4064-a211-3cc5295282f9 \ 
    -X 'DELETE' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 204 No Content


Was this article helpful?

What's Next