This document will help us to achieve the implementation of the notification feature for any specific activity on groups workflow.
Background:
As per the ticket https://project-sunbird.atlassian.net/browse/SB-24361 , we are trying to notify the users when there is some action happened in groups workflow.
As discussed with the UP team, we’ll b using the feed APIs to
Notify the users for some actions.
Mark any notification read
Trigger a notification:
curl --location --request POST 'https://dev.sunbirded.org/api/user/feed/v1/create' \ --header 'Authorization: Bearer <Bearer Key>' \ --header 'x-authenticated-user-token: <user-token>' \ --header 'Content-Type: application/json' \ --data-raw '{ "request": { "userId": "a10d5216-6b96-404c-8d1c-cc1f720d910a", "category": "group-feed", "priority": 1, "data": { "groupId": "12345", //dummy data "message":"Added to the group" } } }'
Read a notification:
curl --location --request POST 'https://dev.sunbirded.org/api/user/feed/v1/update' \ --header 'Authorization: Bearer <auth-token>' \ --header 'x-authenticated-user-token: <user-token>' \ --header 'Content-Type: application/json' \ --data-raw '{ "request": { "userId": "37634e84-70db-421e-898e-06e6554c4483", "category": "user-feed", "feedId": "22ba004f-3b07-429e-bb9a-0bd3dfb21d2b", "data":{ "ds":"dsds" // TODO: modify } } }'