Field Support for Filtering and Sorting

Endpoints that allow for querying follow the API Query Language.

Note that the "hasSome" operator works the same as the operator "IN" in SQL.

Post API

Fields That Allow Filtering

FieldOperatorsSorting Allowed
id$eq, $ne, $hasSomeAllowed
categoryId$eq, $ne
title$eq, $ne, $contains, $hasSome, $urlized, $startsWith, $endsWith, $hasSome
ownerId$eq, $ne
contentText$eq, $ne, $contains, $hasSome, $startsWith, $endsWith, $hasSome
bestAnswerCommentId$eq, $ne
pinned$eq, $neAllowed
commentingEnabled$eq, $ne
commentCount$eq, $ne, $lt, $lte, $gt, $gteAllowed
likeCount$eq, $ne, $lt, $lte, $gt, $gteAllowed
viewCount$eq, $ne, $lt, $lte, $gt, $gteAllowed
createdDate$eq, $ne, $lt, $lte, $gt, $gteAllowed
updatedDate$eq, $ne, $lt, $lte, $gt, $gte
lastActivityDate$eq, $ne, $lt, $lte, $gt, $gteAllowed
slug$eq, $ne, $contains, $hasSome, $urlized, $startsWith, $endsWith, $hasSomeAllowed

Examples

Query pinned posts

Copy
1
curl 'https://www.wixapis.com/forum/v1/posts/query' --data-binary '{"filter": {"pinned": {"$eq": true}}}' -H 'Content-Type: application/json' -H 'Authorization: <AUTH>'

Get all posts, sorted by created date (latest first)

Copy
1
curl 'https://www.wixapis.com/forum/v1/posts/query' --data-binary '{"sort":[{"fieldName": "createdDate", "order": "DESC"}]}' -H 'Content-Type: application/json' -H 'Authorization: <AUTH>'

Get posts by IDs

Copy
1
curl 'https://www.wixapis.com/forum/v1/posts/query' --data-binary '{"filter": {"id": {"$hasSome": ["POST_ID_1","POST_ID_2"]}}}' -H 'Content-Type: application/json' -H 'Authorization: <AUTH>'

Category API

Fields That Allow Filtering

FieldOperatorsSorting Allowed
id$eq, $ne, $hasSomeAllowed
parentId$eq, $ne, $contains, $hasSome, $urlized, $startsWith, $endsWith, $hasSome
name$eq, $ne, $contains, $hasSome, $urlized, $startsWith, $endsWith, $hasSome
rank$eq, $ne, $lt, $lte, $gt, $gteAllowed
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, $hasSomeAllowed
postViewCount$eq, $ne, $contains, $hasSome, $urlized, $startsWith, $endsWith, $hasSomeAllowed
slug$eq, $ne, $contains, $hasSome, $urlized, $startsWith, $endsWith, $hasSome

Examples

Query categories by description

Copy
1
curl 'https://www.wixapis.com/forum/v1/categories/query' --data-binary '{"filter": {"description": {"$contains": "cat"}}}' -H 'Content-Type: application/json' -H 'Authorization: <AUTH>'

Get all categories, sorted by rank

Copy
1
curl 'https://www.wixapis.com/forum/v1/categories/query' --data-binary '{"sort":[{"fieldName": "rank"}]}' -H 'Content-Type: application/json' -H 'Authorization: <AUTH>'

Get categories by IDs

Copy
1
curl 'https://www.wixapis.com/forum/v1/categories/query' --data-binary '{"filter": {"id": {"$hasSome": ["CATEGORY_ID_1","CATEGORY_ID_2"]}}}' -H 'Content-Type: application/json' -H 'Authorization: <AUTH>'

Draft Post API

Fields That Allow Filtering

FieldOperatorsSorting Allowed
id$eq, $ne, $hasSomeAllowed
categoryId$eq, $ne
title$eq, $ne, $contains, $hasSome, $urlized, $startsWith, $endsWith, $hasSome
ownerId$eq, $ne
contentText$eq, $ne, $contains, $hasSome, $startsWith, $endsWith, $hasSome
commentingType$eq, $ne
createdDate$eq, $ne, $lt, $lte, $gt, $gteAllowed

Examples

Query draft post by content text

Copy
1
curl 'https://www.wixapis.com/forum/v1/draft-posts/query' --data-binary '{"filter": {"contentText": {"$contains": "cat"}}}' -H 'Content-Type: application/json' -H 'Authorization: <AUTH>'

Get all draft posts, sorted by createdDate

Copy
1
curl 'https://www.wixapis.com/forum/v1/draft-posts/query' --data-binary '{"sort":[{"fieldName": "createdDate"}]}' -H 'Content-Type: application/json' -H 'Authorization: <AUTH>'

Get draft posts by IDs

Copy
1
curl 'https://www.wixapis.com/forum/v1/draft-posts/query' --data-binary '{"filter": {"id": {"$hasSome": ["DRAFT_POST_ID_1","DRAFT_POST_ID_2"]}}}' -H 'Content-Type: application/json' -H 'Authorization: <AUTH>'
Was this helpful?
Yes
No