Skip to content

Get categories tree

Categories

Returns a hierarchical tree structure of categories filtered by module(s). The response is organized by category module, with each category containing its nested children recursively. Categories are sorted by displayOrder. If topLevelSectionIds is provided, only the specified top-level sections are returned (this filter is only available when querying a single category module).

GET
/category/getTree

Parameters

Query Parameters

module*

Array of category modules to retrieve. Valid values: community, knowledge-base, groups. Example: ?module[]=community&module[]=groups

Type
array
Required
topLevelSectionIds

Optional array of top-level section IDs to filter by. Only available when querying a single module. Example: ?topLevelSectionIds[]=1&topLevelSectionIds[]=2

Type
array
authorId*

The ID of the author making the request

Type
string
Required

Responses

Categories tree retrieved successfully

application/json
JSON
{
  
"result": {
  
  
"additionalProperties": [
  
  
  
{
  
  
  
  
"id": 1,
  
  
  
  
"type": "community",
  
  
  
  
"displayOrder": 0,
  
  
  
  
"title": "General Discussion",
  
  
  
  
"description": "General discussion category",
  
  
  
  
"parentId": 0,
  
  
  
  
"isSection": true,
  
  
  
  
"heroImage": "string",
  
  
  
  
"thumbnailImage": "string",
  
  
  
  
"supportedContentTypes": [
  
  
  
  
  
"idea"
  
  
  
  
],
  
  
  
  
"children": [
  
  
  
  
  
{
  
  
  
  
  
}
  
  
  
  
]
  
  
  
}
  
  
]
  
}
}

Samples

Gainsight CC Developer Portal