API: Groups
Solved
Plugin Development
-
It seems, that there is no API to find to which groups user belongs, like this one (an example):
api/users/1/groups
. Am I correct? -
It's just in the user API
https://community.nodebb.org/api/user/a_5mith - mine for example contains the following:
"groups": [ { "_key": "group:3rd Party Developers", "name": "3rd Party Developers", "description": "NodeBB Plugin and Theme authors", "deleted": 0, "hidden": false, "system": 0, "userTitle": "Plugin & Theme Dev", "icon": "fa-cogs", "labelColor": "#2b8000", "createtime": 1422301731571, "slug": "3rd-party-developers", "memberCount": 17, "private": 1, "userTitleEnabled": true, "createtimeISO": "2015-01-26T19:48:51.571Z", "cover:url": "/images/cover-default.png", "cover:position": "50% 50%" }, { "_key": "group:Community Representatives", "name": "Community Representatives", "description": "Users helping the NodeBB team spread the word!", "deleted": 0, "hidden": false, "system": 0, "userTitle": "Community Rep", "icon": "fa-bullhorn", "labelColor": "orange", "createtime": 1422301731571, "slug": "community-representatives", "memberCount": 8, "userTitleEnabled": true, "createtimeISO": "2015-01-26T19:48:51.571Z", "cover:url": "/images/cover-default.png", "cover:position": "50% 50%" } ],
-
It provides only not-hidden groups
-
Created a small plugin, to have access to all groups - https://community.nodebb.org/topic/4591/nodebb-plugin-ns-api-ns-api-extended
Copyright © 2024 NodeBB | Contributors