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

Get Category By Slug

Developer Preview

Returns a single category by URL slug.

Syntax

function GetCategory By Slug(slug: string, extraFields: array<_com_wixpress_npm_communities_forum_api_CategoryExtraField_Field>): GetCategoryBySlug<_com_wixpress_npm_communities_forum_api_CategoryResponse>

Get Category By Slug Parameters

NAME
TYPE
DESCRIPTION
slug
Required
string

URL slug.

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
category
object

Retrieved category for the provided category ID.

Was this helpful?

Request

curl

Copy Code
1curl -X GET https://www.wixapis.com/forum/v1/categories/slugs/discussion-corner
2 -H 'Content-Type: application/json;charset=UTF-8'
3 -H 'Authorization: <ACCESS_TOKEN>'

Response

json

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