...
Code Block |
---|
command: nodebb activate nodebb-plugin-plugin-name Example: nodebb activate nodebb-plugin-write-api |
...
Creating Nodebb Token
Login as a Admin
Go to admin pannel
3. Click on PLUGINS and select write api in the drop down.
...
4. Enter Admin uid and click on create token
...
How to find admin uid
1.Go to admin pannel.
2.click on Manage and select users
...
3. You can see the list of users here
...
Store Sunbird identifier mapped with NodeBB category
Post: {host}/discussion/forum/v2/create
cUrl:
Code Block |
---|
curl --location --request POST 'https://staging.sunbirded.org/discussions/api/forum/v2/create' \
--header 'Content-Type: application/json' \
--header 'Cookie: express.sid=s%3Aoc2sRQiZbgFE-oQRgfcQq3xZoFZWqxGS.J%2BsjxRf3Y3i8%2FJvLjdsxTNjMAmEebSEvmDCJV34aOp4' \
--data-raw '{
"request": {
"sbType": "course",
"sbIdentifier": "do_21307805474221260815237",
"cid": 6
}
}' |
Request:
Code Block |
---|
{
"request": {
"sbType": "course",
"sbIdentifier": "do_21307805474221260815237",
"cid": 6
}
} |
Response:
Code Block |
---|
{
"id": "api.discussions.category.forum",
"ver": "1.0",
"ets": 1610038157022,
"params": {
"resmsgid": "ae9dec88-bf9d-4907-bed0-5ef8b86d6cae",
"msgid": "",
"status": "successful"
},
"responseCode": "OK",
"result": {
"_id": "5ff73b8d1e9b1c00956d377b",
"sbType": "course",
"sbIdentifier": "do_21307805474221260815237",
"cid": 6,
"__v": 0
}
} |
Get Category mapped to Sunbird Identifier
API to get the NodeBB category(or categories) mapped to the sunbird content or Group etc.
Post: {host}/discussion/forum/v2/read
Curl:
Code Block |
---|
curl --location --request POST 'https://staging.sunbirded.org/discussions/api/forum/v2/read' \
--header 'Content-Type: application/json' \
--header 'Cookie: express.sid=s%3Aoc2sRQiZbgFE-oQRgfcQq3xZoFZWqxGS.J%2BsjxRf3Y3i8%2FJvLjdsxTNjMAmEebSEvmDCJV34aOp4' \
--data-raw '{
"request": {
"type": "course",
"identifier": "do_21307805474221260815237"
}
}' |
Request:
Code Block |
---|
{
"request": {
"type": "course",
"identifier": ["do_21307805474221260815237"]
}
} |
Response:
Code Block |
---|
{
"id": "api.discussions.category.forum",
"ver": "1.0",
"ets": 1610038493573,
"params": {
"resmsgid": "b03d8c99-2abc-4d6f-bbfc-c8067a10b74d",
"msgid": "",
"status": "successful"
},
"responseCode": "OK",
"result": [
{
"_id": "5ff73b8d1e9b1c00956d377b",
"sbType": "course",
"sbIdentifier": "do_21307805474221260815237",
"cid": 6,
"__v": 0
}
]
} |
Issues:
1. SbCategory schema creation having issue in staging
...