Discussion forum: Key processes to enable/disable DF.
This document will help to configure (enable/disable) discussion forum for any of the learning process
(i.e. groups, course, textbook, etc.)
For Groups:
Enabling discussion forums for groups will be done via UI.
Now to call the create forum API, first, we need to configure a form API that will respond back the request payload for creating the forum.
Step: 1
Configure form API:
Endpoint:
POST: {{host}}/data/v1/form/create
Request payload:
{
"request": {
"type": "forum",
"subType": "group",
"action": "create",
"data": {
"templateName": "defaultTemplate",
"action": "create",
"fields": [
{
"category": {
"name": "General Discussion", // Forum name
"pid": "15", // parent category id, under this category, new forum will be
creted. it will be a root category.
"uid": "1", // admin user id
"description": "",
"context": [
{
"type": "group",
"identifier": "_groupId" // to be replaced form client
side with actul group id.
}
]
}
}
]
}
}
}
Once created, this form API will be called from the client-side.
Endpoint:
POST: {{host}}/data/v1/form/read
Request payload:
Response:
NOTE: the context identifier should be replaced from the client-side with actual group_id before calling the “forum create” API. So, in basic words, this form response will work as a request payload for the actual forum create API.
Step 2:
Call the create forum API :
Endpoint:
Request payload:
Response:
Postman Collection
Discussion Forum API's Postman collection
For courses:
Till now, a Discussion forum for courses can be configured via APIs only.
Below APIs will be used to configure a discussion forum for any of the courses.
Step 1:
Create a parent category. This category id will be used as the root pid
Endpoint:
Request body:
Response:
Step 2:
Take the above created CID and make the create forum API call for course:
Endpoint:
Request Body:
Response:
Step: 3
After creating course level category, we have to create batch level category. For the batch level also we are using same api (forum create).
End Point
Note: Take the newCid
value from the above response.
Request Body
Response
Some Usfull Apis:
Access the groups and group users attached to a category.
End Point
Request Body
Response
2. Add multiple users into multiple groups
End Point
Request Body
Response
This api will return list of users added into that group along with newly added user.
3. To check list of privileges added to a particular group with a category.
End Point
Request
Response Body