Category APIs

Add a new category

post

This api allows the user to create a new category in nodebb

Header parameters
AuthorizationstringRequired
Body
namestringRequired
descriptionstringRequired
bgColorstringRequired
colorstringRequired
parentCidintegerRequired
classstringRequired
Responses
200

successful operation

application/json
post
/discussion/v2/categories

Get category details

get

This api allows the user to get all details of a category by using categoryId and slug from nodebb.

Path parameters
category_idstringRequired
slugstringRequired
Header parameters
AuthorizationstringRequired
Responses
200

successful operation

application/json
get
/discussion/category/{category_id}/{slug}

Get the category details by category id

get

This api allow the user to get all the details of categories using categoryId from nodebb

Path parameters
cidstringRequired
Header parameters
AuthorizationstringRequired
Responses
200

successful operation

application/json
get
/discussion/category/{cid}

Get List of category details

post

This api allow the user to get all the details of categories based on cid mentioned in array from nodebb

Header parameters
AuthorizationstringRequired
Body
Responses
200

successful operation

application/json
post
/discussion/category/list

Updates already existing catrgory details

put

This api can updated the category details based on the category id which we created previously

Path parameters
cidintegerRequired
Header parameters
AuthorizationstringOptional
Body
namestringRequired
descriptionstringRequired
bgColorstringRequired
colorstringRequired
parentCidintegerRequired
classstringRequired
Responses
200

successful operation

application/json
put
/discussion/v2/categories/{cid}

Delete the Category

delete

This api allows the user to delete the existing category by using categoryID from nodebb

Path parameters
cidintegerRequired
Header parameters
AuthorizationstringOptional
Responses
200

successful operation

application/json
delete
/discussion/v2/categories/{cid}

Get the moderators list for a category

get

This api can get the list of category moderators based on the category ID that we created previously

Path parameters
cidintegerRequired
Header parameters
AuthorizationstringOptional
Responses
200

successful operation

application/json
get
/discussion/v2/categories/{cid}/moderators

Enable category

put

This api allow the user to enable the category(If the category is in disable state)

Path parameters
cidintegerRequired
Header parameters
AuthorizationstringRequired
Responses
200

successful operation

application/json
put
/discussion/v2/categories/{cid}/state

Add privileges to category

put

This api allow the user to add privilages for category in nodebb.

Path parameters
cidintegerRequired
Header parameters
AuthorizationstringRequired
Bodystring[]
string[]Optional
Responses
200

successful operation

application/json
put
/discussion/v2/categories/{cid}/privileges

Remove privileges for a category

delete

This api allow user to remove privileges for a category in nodebb.

Path parameters
cidintegerRequired
Header parameters
AuthorizationstringRequired
Responses
200

successful operation

application/json
delete
/discussion/v2/categories/{cid}/privileges

Last updated

Was this helpful?