Discussion forum integration with any application
Last updated
Was this helpful?
Was this helpful?
POST: /data/v1/form/create {
"request": {
"type": "forum",
"subType": "group",
"action": "create",
"data": {
"templateName": "defaultTemplate",
"action": "create",
"fields": [
{
"category": {
"name": "General Discussion",
"pid": "30",
"uid": "4",
"description": "",
"context": [
{
"type": "group",
"identifier": "_groupId"
}
]
}
}
]
}
}
}POST: /data/v1/form/read {
"request": {
"type": "forum",
"subType": "group",
"action": "create"
}
}{
"id": "api.form.read",
"params": {
"resmsgid": "f18a1975-8d64-4590-b419-be495cd9d6c4",
"msgid": "255e08db-2464-4edd-aab6-cbde4308f53e",
"status": "successful"
},
"responseCode": "OK",
"result": {
"form": {
"type": "forum",
"subtype": "group",
"action": "create",
"component": "*",
"framework": "*",
"data": {
"templateName": "defaultTemplate",
"action": "create",
"fields": [
{
"category": {
"name": "General Discussion",
"pid": "30",
"uid": "4",
"description": "",
"context": [
{
"type": "group",
"identifier": "_groupId"
}
]
}
}
]
},
"created_on": "2021-02-15T05:33:03.734Z",
"last_modified_on": "2021-02-15T09:52:41.820Z",
"rootOrgId": "*"
}
},
"ts": "2021-02-15T10:14:08.707Z",
"ver": "1.0"
}{
"category": {
"name": "General Discussion", // Name of the category
"pid": "30", // parent category id, under this category we are creating new categories
"description": "", // category description: Optional
"context": [
{
"type": "group", // type as a group
"identifier": "bc190919-f9a4-4e8a-a48b-2bba9c0b827f" // group Id
}
]
}
}curl 'https://staging.sunbirded.org/discussion/forum/v3/create' \
-H 'Connection: keep-alive' \
-H 'sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="97", "Chromium";v="97"' \
-H 'X-App-Id: staging.sunbird.portal' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36' \
-H 'Content-Type: application/json' \
-H 'Access-Control-Allow-Origin: *' \
-H 'Accept: application/json' \
-H 'X-Device-Id: 23b82f7e68c9974eb17af148415a6067' \
-H 'X-Channel-Id: 0126796199493140480' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'Origin: https://staging.sunbirded.org' \
-H 'Sec-Fetch-Site: same-origin' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Referer: https://staging.sunbirded.org/my-groups/group-details/bc190919-f9a4-4e8a-a48b-2bba9c0b827f' \
-H 'Accept-Language: en-GB,en;q=0.9' \
-H 'Cookie: connect.sid=s%3AS3j18UnlsjcbY4_kbWjfCdO7iBvR0h_G.1dWXH%2Ba%2BUZ3zyFN4JnK2ucdU9mFqkRfmiPJrTgxulPU' \
--data-raw '{"category":{"name":"General Discussion","pid":"30","uid":"4","description":"","context":[{"type":"group","identifier":"bc190919-f9a4-4e8a-a48b-2bba9c0b827f"}]}}' \
--compressed{
"id": ".discussions.api.forum.v3.create",
"ver": "1.0",
"ets": 1642673148032,
"params": {
"resmsgid": "16ea8c5b-682c-4ac2-889e-d5896fc057fd",
"msgid": "",
"status": "Success"
},
"responseCode": "OK",
"result": {
"forums": [
{
"sbType": "group",
"sbIdentifier": "bc190919-f9a4-4e8a-a48b-2bba9c0b827f",
"newCid": 801, // New category created for group context
"cids": [801]
}
]
}
}