Category APIs
Last updated
Was this helpful?
Last updated
Was this helpful?
This api allows the user to get all details of a category by using categoryId and slug from nodebb.
/category/{category_id}/{slug}
{"unread-class":"unread-class","template":{},"privileges":{},"pagination":{},"color":"color","numRecentReplies":5,"icon":"icon","link":"link","_header":{},"description":"description","title":"title","widgets":{},"showSelect":true,"totalTopicCount":7,"parentCid":2,"maxTags":2,"totalPostCount":4,"bgColor":"bgColor","descriptionParsed":"descriptionParsed","children":[{},{}],"bodyClass":"bodyClass","disabled":6,"rssFeedUrl":"rssFeedUrl","tagWhitelist":["tagWhitelist","tagWhitelist"],"class":"class","slug":"slug","order":5,"minTags":3,"showTopicTools":true,"topics":[{"pinned":6,"lastposttime":1,"upvotes":8,"unreplied":true,"unread":true,"timestampISO":"timestampISO","title":"title","teaserPid":{},"tid":7,"uid":4,"lastposttimeISO":"lastposttimeISO","deleterUid":6,"isOwner":true,"mainPid":1,"locked":9,"slug":"slug","timestamp":1,"ignored":true,"index":6,"downvotes":9,"icons":{},"tags":{},"bookmark":{},"deleted":9,"postcount":6,"viewcount":5,"titleRaw":"titleRaw","votes":3,"category":{},"user":{},"cid":1,"teaser":{}},{"pinned":6,"lastposttime":1,"upvotes":8,"unreplied":true,"unread":true,"timestampISO":"timestampISO","title":"title","teaserPid":{},"tid":7,"uid":4,"lastposttimeISO":"lastposttimeISO","deleterUid":6,"isOwner":true,"mainPid":1,"locked":9,"slug":"slug","timestamp":1,"ignored":true,"index":6,"downvotes":9,"icons":{},"tags":{},"bookmark":{},"deleted":9,"postcount":6,"viewcount":5,"titleRaw":"titleRaw","votes":3,"category":{},"user":{},"cid":1,"teaser":{}}],"isNotWatched":true,"reputation:disabled":2,"isWatched":true,"isIgnored":true,"topic_count":9,"url":"url","imageClass":"imageClass","feeds:disableRSS":1,"loggedIn":true,"name":"name","isSection":1,"post_count":7,"relative_path":"relative_path","breadcrumbs":[{},{}],"cid":0}
This api allow the user to get all the details of categories using categoryId from nodebb
/category/{cid}
{"unread-class":"unread-class","template":{},"privileges":{},"pagination":{},"color":"color","numRecentReplies":5,"icon":"icon","link":"link","_header":{},"description":"description","title":"title","widgets":{},"showSelect":true,"totalTopicCount":7,"parentCid":2,"maxTags":2,"totalPostCount":4,"bgColor":"bgColor","descriptionParsed":"descriptionParsed","children":[{},{}],"bodyClass":"bodyClass","disabled":6,"rssFeedUrl":"rssFeedUrl","tagWhitelist":["tagWhitelist","tagWhitelist"],"class":"class","slug":"slug","order":5,"minTags":3,"showTopicTools":true,"topics":[{"pinned":6,"lastposttime":1,"upvotes":8,"unreplied":true,"unread":true,"timestampISO":"timestampISO","title":"title","teaserPid":{},"tid":7,"uid":4,"lastposttimeISO":"lastposttimeISO","deleterUid":6,"isOwner":true,"mainPid":1,"locked":9,"slug":"slug","timestamp":1,"ignored":true,"index":6,"downvotes":9,"icons":{},"tags":{},"bookmark":{},"deleted":9,"postcount":6,"viewcount":5,"titleRaw":"titleRaw","votes":3,"category":{},"user":{},"cid":1,"teaser":{}},{"pinned":6,"lastposttime":1,"upvotes":8,"unreplied":true,"unread":true,"timestampISO":"timestampISO","title":"title","teaserPid":{},"tid":7,"uid":4,"lastposttimeISO":"lastposttimeISO","deleterUid":6,"isOwner":true,"mainPid":1,"locked":9,"slug":"slug","timestamp":1,"ignored":true,"index":6,"downvotes":9,"icons":{},"tags":{},"bookmark":{},"deleted":9,"postcount":6,"viewcount":5,"titleRaw":"titleRaw","votes":3,"category":{},"user":{},"cid":1,"teaser":{}}],"isNotWatched":true,"reputation:disabled":2,"isWatched":true,"isIgnored":true,"topic_count":9,"url":"url","imageClass":"imageClass","feeds:disableRSS":1,"loggedIn":true,"name":"name","isSection":1,"post_count":7,"relative_path":"relative_path","breadcrumbs":[{},{}],"cid":0}
This api allows the user to delete the existing category by using categoryID from nodebb
/v2/categories/{cid}
{"code":"code","payload":{}}
This api can get the list of category moderators based on the category ID that we created previously
/v2/categories/{cid}/moderators
This api allow the user to enable the category(If the category is in disable state)
/v2/categories/{cid}/state
{"code":"code","payload":{}}
This api allow user to remove privileges for a category in nodebb.
/v2/categories/{cid}/state
{"code":"code","payload":{}}
This api allows the user to create a new category in nodebb
/v2/categories
{"code":"code","payload":{"color":"color","numRecentReplies":"numRecentReplies","icon":"icon","link":"link","description":"description","topic_count":"topic_count","imageClass":"imageClass","parentCid":6,"descriptionParsed":"descriptionParsed","bgColor":"bgColor","name":"name","disabled":"disabled","post_count":"post_count","isSection":"isSection","class":"class","slug":"slug","cid":0,"order":"order"}}
This api allow the user to get all the details of categories based on cid mentioned in array from nodebb
/category/list
{"unread-class":"unread-class","template":{},"privileges":{},"pagination":{},"color":"color","numRecentReplies":5,"icon":"icon","link":"link","_header":{},"description":"description","title":"title","widgets":{},"showSelect":true,"totalTopicCount":7,"parentCid":2,"maxTags":2,"totalPostCount":4,"bgColor":"bgColor","descriptionParsed":"descriptionParsed","children":[{},{}],"bodyClass":"bodyClass","disabled":6,"rssFeedUrl":"rssFeedUrl","tagWhitelist":["tagWhitelist","tagWhitelist"],"class":"class","slug":"slug","order":5,"minTags":3,"showTopicTools":true,"topics":[{"pinned":6,"lastposttime":1,"upvotes":8,"unreplied":true,"unread":true,"timestampISO":"timestampISO","title":"title","teaserPid":{},"tid":7,"uid":4,"lastposttimeISO":"lastposttimeISO","deleterUid":6,"isOwner":true,"mainPid":1,"locked":9,"slug":"slug","timestamp":1,"ignored":true,"index":6,"downvotes":9,"icons":{},"tags":{},"bookmark":{},"deleted":9,"postcount":6,"viewcount":5,"titleRaw":"titleRaw","votes":3,"category":{},"user":{},"cid":1,"teaser":{}},{"pinned":6,"lastposttime":1,"upvotes":8,"unreplied":true,"unread":true,"timestampISO":"timestampISO","title":"title","teaserPid":{},"tid":7,"uid":4,"lastposttimeISO":"lastposttimeISO","deleterUid":6,"isOwner":true,"mainPid":1,"locked":9,"slug":"slug","timestamp":1,"ignored":true,"index":6,"downvotes":9,"icons":{},"tags":{},"bookmark":{},"deleted":9,"postcount":6,"viewcount":5,"titleRaw":"titleRaw","votes":3,"category":{},"user":{},"cid":1,"teaser":{}}],"isNotWatched":true,"reputation:disabled":2,"isWatched":true,"isIgnored":true,"topic_count":9,"url":"url","imageClass":"imageClass","feeds:disableRSS":1,"loggedIn":true,"name":"name","isSection":1,"post_count":7,"relative_path":"relative_path","breadcrumbs":[{},{}],"cid":0}
This api can updated the category details based on the category id which we created previously
/v2/categories/{cid}
{"code":"code","payload":{"color":"color","numRecentReplies":"numRecentReplies","icon":"icon","link":"link","description":"description","topic_count":"topic_count","imageClass":"imageClass","parentCid":6,"descriptionParsed":"descriptionParsed","bgColor":"bgColor","name":"name","disabled":"disabled","post_count":"post_count","isSection":"isSection","class":"class","slug":"slug","cid":0,"order":"order"}}
This api allow the user to add privilages for category in nodebb.
/v2/categories/{cid}/privileges
{"code":"code","payload":{}}