Search.../
  1. REST
Generate a test token to explore our APIs

Query Categories

Developer Preview

Returns a list of categories by query

Paging

  • limit: default - 10, min - 0, max - 100
  • offset: default - 0, min - 0

Filterable fields:

  • id
  • parentId
  • name
  • rank
  • headerTitle
  • headerType
  • headerDescription
  • postCount
  • postViewCount
  • slug

Sortable fields:

  • rank
  • postCount
  • postViewCount

Syntax

function QueryCategories(paging: _com_wixpress_npm_communities_forum_api_CategoriesPaging, filter: struct, sort: array<_com_wixpress_npm_communities_forum_api_CategoriesSort>, extraFields: array<_com_wixpress_npm_communities_forum_api_CategoryExtraField_Field>): QueryCategories<_com_wixpress_npm_communities_forum_api_QueryCategoriesResponse>

Query Categories Parameters

NAME
TYPE
DESCRIPTION
paging
object

Paging object (e.g., {limit: 10, offset: 100 } )

filter
object

Filter object (e.g., { $and: [{ postViewCount: { $gt: 0 } }, { postCount: { $gt: 0 }] } )

sort
Array<object>

Array of sort objects (e.g., [{ fieldName: rank, order: Order.ASC }] )

extraFields
Array<string>

Supported values: UNKNOWN, URL.

Array of extra category fields to be added in the response. UNKNOWN must not be passed.

Returns

Return Type:

object
NAME
TYPE
DESCRIPTION
categories
Array<object>

List of categories.

metaData
object

Pagination.

Was this helpful?

Request

curl

Copy Code
1curl -X POST https://www.wixapis.com/forum/v1/categories/query
2 -H 'Content-Type: application/json;charset=UTF-8'
3 -H 'Authorization: <ACCESS_TOKEN>'
4 -d '{
5 "paging": {
6 "offset": 0,
7 "limit": 1
8 },
9 "filter": {
10 "rank": {
11 "$eq": 0
12 }
13 },
14 "sort": [
15 {
16 "fieldName": "rank",
17 "order": "ASC"
18 }
19 ]
20 }'

Response

json

1{
2 "categories": [ {
3 "id": "5cacd5fe04976c0015f35362",
4 "parentId": "001005fe04976c0015f35362",
5 "name": "Discussion corner",
6 "headerTitle": "Discussion corner",
7 "description": "Share stories, ideas, pictures and more!",
8 "headerType": "IMAGE",
9 "headerImage": {
10 "id": "image.jpg",
11 "url": "https://static.wixstatic.com/media/image.jpg",
12 "height": 760,
13 "width": 2100
14 },
15 "rank": 0,
16 "postCount": 2,
17 "postViewCount": 17,
18 "slug": "discussion-corner",
19 "noMemberPosting": true,
20 "categoryAccess": "PUBLIC",
21 "createdDate": "2019-04-09T17:27:26.171Z",
22 "updatedDate": "2019-04-09T17:27:26.171Z",
23 "postTypes": [
24 "DISCUSSION",
25 "QUESTION"
26 ],
27 "commentInteraction": "REACTION",
28 "url": {
29 "base": "https://wix.com",
30 "path": "/forum/discussion-corner"
31 }
32 }],
33 "metaData": {
34 "count": 1,
35 "offset": 0,
36 "total": 1
37 }
38}