POST

Query Categories


Developer Preview

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 is 10
  • paging.offset is 0

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.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Forums
Read Forums
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/forum/v1/categories/query

Body Params
pagingPaging

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


filterstruct

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


sortArray <CategoriesSort>

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


extraFieldsArray <string>

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

Response Object
categoriesArray <Category>

List of categories.


metaDataMetaData

Pagination.

Query Categories Example 1
Request
cURL
curl -X POST https://www.wixapis.com/forum/v1/categories/query -H 'Content-Type: application/json;charset=UTF-8' -H 'Authorization: <ACCESS_TOKEN>' -d '{ "paging": { "offset": 0, "limit": 1 }, "filter": { "rank": { "$eq": 0 } }, "sort": [ { "fieldName": "rank", "order": "ASC" } ] }'
Response
JSON
{ "categories": [ { "id": "5cacd5fe04976c0015f35362", "parentId": "001005fe04976c0015f35362", "name": "Discussion corner", "headerTitle": "Discussion corner", "description": "Share stories, ideas, pictures and more!", "headerType": "IMAGE", "headerImage": { "id": "image.jpg", "url": "https://static.wixstatic.com/media/image.jpg", "height": 760, "width": 2100 }, "rank": 0, "postCount": 2, "postViewCount": 17, "slug": "discussion-corner", "noMemberPosting": true, "categoryAccess": "PUBLIC", "createdDate": "2019-04-09T17:27:26.171Z", "updatedDate": "2019-04-09T17:27:26.171Z", "postTypes": ["DISCUSSION", "QUESTION"], "postInteraction": "MULTIPLE_REACTIONS", "mainPostReactionIcon": { "iconType": "LOVE", "code": ":love:" }, "additionalPostReactions": [ { "iconType": "THUMBS_UP", "code": ":thumbs_up:" } ], "commentInteraction": "REACTION", "mainCommentReactionIcon": { "iconType": "THUMBS_UP", "code": ":thumbs_up:" }, "additionalCommentReactions": [ { "iconType": "THUMBS_UP", "code": ":thumbs_up:" } ], "guestReactionsEnabled": false, "guestCommentsEnabled": false, "commentOrder": "NEWEST", "commentRepliesEnabled": true, "commentButtonLabel": "Publish", "commentPlaceholderText": "Leave a comment", "commentSectionHeader": "Comments", "url": { "base": "https://wix.com", "path": "/forum/discussion-corner" } } ], "metaData": { "count": 1, "offset": 0, "total": 1 } }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?