Setup
To use the Categories API, install the @wix/forum
package using npm or Yarn:
1npm install @wix/forum
or
1yarn add @wix/forum
Then import { categories }
from @wix/forum
:
1import { categories } from '@wix/forum'
Categories: Supported Filters and Sorting
The following table shows field support for filters and sorting for the Category object:
Field | Supported Filters | Sortable |
---|---|---|
id | $eq , $ne , $hasSome | Sortable |
parentId | $eq , $ne , $contains , $hasSome , $urlized , $startsWith , $endsWith , $hasSome | |
name | $eq , $ne , $contains , $hasSome , $urlized , $startsWith , $endsWith , $hasSome | |
rank | $eq , $ne , $lt , $lte , $gt , $gte | Sortable |
headerTitle | $eq , $ne , $contains , $hasSome , $urlized , $startsWith , $endsWith , $hasSome | |
headerType | $eq , $ne , $contains , $hasSome , $urlized , $startsWith , $endsWith , $hasSome | |
description | $eq , $ne , $contains , $hasSome , $startsWith , $endsWith , $hasSome | |
postCount | $eq , $ne , $contains , $hasSome , $urlized , $startsWith , $endsWith , $hasSome | Sortable |
postViewCount | $eq , $ne , $contains , $hasSome , $urlized , $startsWith , $endsWith , $hasSome | Sortable |
slug | $eq , $ne , $contains , $hasSome , $urlized , $startsWith , $endsWith , $hasSome |
Related content: API Query Language, queryCategories( )
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Returns a single category by ID.
Permission Scopes
For app development, you must have one of the following permission scopes:function getCategory(categoryId: string, options: GetCategoryOptions): Promise<Category>
ID of the retrieved category.
Options specifying which fields to return.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Returns a single category by URL slug.
Permission Scopes
For app development, you must have one of the following permission scopes:function getCategoryBySlug(slug: string, options: GetCategoryBySlugOptions): Promise<CategoryResponse>
URL slug.
Options specifying which fields to return.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves a list of categories, given the provided paging, filtering, and sorting.
Query Categories runs with these defaults, which you can override:
paging.limit
is10
paging.offset
is0
For field support for filters and sorting, see Categories: Supported Filters and Sorting.
To learn about working with Query endpoints, see API Query Language, Sorting and Paging, and Field Projection.
Permission Scopes
For app development, you must have one of the following permission scopes:function queryCategories(options: QueryCategoriesOptions): Promise<QueryCategoriesResponse>
Options for sorting, filtering, paging, and specifying return fields.