Forum APIs
This api allow the user to get the forum id
- The endpoint for Forum is
/forum/v2/read
- The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
- Backend Route: http://nodebb-service:4567/discussions/api/forum/v2/read
POST /api/discussion/forum/v2/read HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 62
{
"request": {
"type": "course",
"identifier": "do_12345678996312"
}
}
successful operation
[
{
"identifier": "identifier",
"type": "type",
"cid": 0
}
]
This api allow the user to attaching category id with a context
- The endpoint for Forum is
/forum/v3/create
- The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
- Backend Route: http://nodebb-service:4567/discussions/api/forum/v3/create
POST /api/discussion/forum/v3/create HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 321
{
"category": {
"name": "Batch 1",
"pid": 567,
"description": "Mentors can start discussions",
"privileges": {
"copyFromCategory": 268
},
"context": [
{
"type": "batch",
"identifier": "01307806402750054416"
}
],
"subcategories": [
{
"name": "Annoucements",
"description": "Only creators can make annoucements",
"privileges": {
"copyFromParent": true
}
}
]
}
}
successful operation
[
{
"forums": [
{
"sbType": "batch",
"sbIdentifier": "01307806402750054416",
"newCid": 580,
"cids": [
580
]
}
],
"groups": [
{
"name": "registered-users",
"members": [
{
"uid": 29,
"userName": "content_reviewer_tn1970",
"sbUid": "08631a74-4b94-4cf7-a818-831135248a4a"
}
]
}
],
"subcategories": [
{
"name": "Annoucements",
"cid": 581,
"pid": 580,
"groups": [
{
"name": "registered-users",
"members": [
{
"uid": 29,
"userName": "content_reviewer_tn1970",
"sbUid": "08631a74-4b94-4cf7-a818-831135248a4a"
}
]
}
]
}
]
}
]
This api allow the user to remove forum id
- The endpoint for Forum is
/forum/v2/remove
- The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
- Backend Route: http://nodebb-service:4567/discussions/api/forum/v2/remove
POST /api/discussion/forum/v2/remove HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 59
{
"sbType": "course",
"cid": [
2
],
"sbIdentifier": "do_123456789"
}
successful operation
[
{
"id": "api.forum.v2.remove",
"ver": "1.0",
"ets": 1618421469097,
"params": {
"resmsgid": "01d3023f-e68f-4e5a-84dc-e67aa69dfd48",
"msgid": "",
"status": "Success"
},
"responseCode": "OK",
"result": "Forum remove for context success"
}
]
This api allow the user to get nodebb id bypassing sunbird id
- The endpoint for Forum is
/forum/v2/uids
- The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
- Backend Route: http://nodebb-service:4567/discussions/api/forum/v2/uids
POST /api/discussion/forum/v2/uids HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 70
{
"request": {
"sbIdentifiers": [
"08631a74-4b94-4cf7-a818-831135248a4a"
]
}
}
successful operation
[
{
"id": ".api.forum.v2.uids",
"ver": "1.0",
"ets": 1618428120524,
"params": {
"resmsgid": "3bf46d2d-6dd4-49e5-a2e7-6b7fa16101b3",
"msgid": "",
"status": "Success"
},
"responseCode": "OK",
"result": {
"userIds": [
{
"nodebbUid": 29,
"sbUid": "08631a74-4b94-4cf7-a818-831135248a4a"
}
]
}
}
]
This api allow the user to get nodebb users added for a category
- The endpoint for Forum is
/forum/v3/groups/users
- The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
- Backend Route: http://nodebb-service:4567/discussions/api/forum/v3/groups/users
POST /api/discussion/forum/v3/groups/users HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 23
{
"request": {
"cid": 268
}
}
successful operation
[
{
"result": {
"groups": [
{
"name": "text",
"members": [
{
"uid": 1,
"userName": "text",
"sbUid": "text"
}
]
}
]
}
}
]
This api allow the user to add sunbird users into nodebb group
- The endpoint for Forum is
/forum/v3/groups/membership
- The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
- Backend Route: http://nodebb-service:4567/discussions/api/forum/v3/groups/membership
POST /api/discussion/forum/v3/group/membership HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 141
{
"request": {
"groups": [
"Category Owner"
],
"members": [
{
"sbUserName": "content_reviewer_tn1970",
"sbUid": "08631a74-4b94-4cf7-a818-831135248a4a"
}
]
}
}
successful operation
[
{
"groups": [
{
"name": "text",
"members": [
{
"uid": 1,
"userName": "text",
"sbUid": "text"
}
]
}
]
}
]
This api allow the user to get context based tags
- The endpoint for Forum is
/forum/tags
- The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
- Backend Route: http://nodebb-service:4567/discussions/api/forum/tags
POST /api/discussion/forum/tags HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 26
{
"request": {
"cids": [
2,
3
]
}
}
successful operation
[
{
"value": "text",
"valueEscaped": "text",
"color": "text",
"bgColor": "text",
"score": 1
}
]
This api allow the user to get nodebb privileges added for a category
- The endpoint for Forum is
/forum/v3/category/{cid}/privileges
- The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
- Backend Route: http://nodebb-service:4567/discussions/api/forum/v3/category/{cid}/privileges
POST /api/discussion/forum/v3/category/{cid}/privileges HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 60
{
"request": {
"groups": [
"Category Owner",
"registered-users"
]
}
}
successful operation
[
{
"groups": [
{
"name": "text",
"nameEscaped": "text",
"privileges": {},
"isPrivate": true,
"isSystem": true
}
]
}
]
This api is used to fetch tags from nodebb.
- The endpoint for Tags is
/tags
- The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
- Backend Route: http://nodebb-service:4567/discussions/api/tags
GET /api/discussion/tags HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
[
{
"value": "learning",
"score": 1,
"valueEscaped": "learning",
"color": "#FFF",
"bgColor": "#EEE"
}
]
This api allow the user to get all the details of category based on tag name and cid mentioned in array from nodebb
- The endpoint for Tag is
/tags/list
- The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
- Backend Route: http://nodebb-service:4567/discussions/api/tags/list
POST /api/discussion/tags/list HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 40
{
"request": {
"tag": "nodebb",
"cid": [
2,
3
]
}
}
[
{
"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 copy all privileges from one category to another category.
- The endpoint for Privileges is
/privileges/v2/copy
- The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
- Backend Route: http://nodebb-service:4567/discussions/api/privileges/v2/copy
POST /api/discussion/privileges/v2/copy HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 29
{
"request": {
"pid": 2,
"cid": 3
}
}
{
"id": "api.forum.v2.remove",
"ver": "1.0",
"ets": 1618421469097,
"params": {
"resmsgid": "01d3023f-e68f-4e5a-84dc-e67aa69dfd48",
"msgid": "",
"status": "Success"
},
"responseCode": "OK",
"result": "Privileges copied successfuly"
}
Last updated
Was this helpful?