Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
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": "e79ee6a4-d79c-4236-9e05-f754010932d6",
    "category": "group-feed",
    "priority": 1,
    "data": {
      "groupIdactionData": {
          "actionType": "c59cca34-c574-49ad-953b-c1cfc7ad50a3groupNotify",
          "messagetitle":"You are added to a group. Click here to explore", // this should be a dynamic message "Title for Notification",
          "description": "Description which will be displayed in Notification",
          "activityIdcontentURL": "my-groups/group-details/c59cca34-c574-49ad-953b-c1cfc7ad50a3", 
  // this should be added when we add activity to a group"identifier": //
      }
  }
}'

Response:

Code Block
{
    "id": "api.user.feed.create",
    "ver": "v1",
    "ts": "2021-05-07 06:08:30:954+0000",
    "params": {
        "resmsgid": null,
        "msgid": "9238f58b985ff0903692475346dc2cee",
        "err": null,
        "status": "success",
        "errmsg": null
    },
    "responseCode": "OK",
    "result": {
        "response": "SUCCESS"
    }
}

...

Code Block
{
    "id": "api.user.feed.e79ee6a4-d79c-4236-9e05-f754010932d6",
    "ver": "v1",
    "ts": "2021-05-0710 0605:3254:4935:561649+0000",
    "params": {
        "resmsgid": null,
        "msgid": "be4d91699dd609f36677eee9c9b57d3b8470ecb7fa05d7d22313a30c9a16927d",
        "err": null,
        "status": "success",
        "errmsg": null
    },
    "responseCode": "OK",
    "result": {
        "response": {
            "userFeed": [
                {
                    "id": "1181f2c1ddab7b78-e9445978-473b4a11-8b87b7f8-b9513087347b6594c7a6e7b8",
                    "userId": "e79ee6a4-d79c-4236-9e05-f754010932d6",
                    "category": "group-feed",
                    "priority": 1,
                    "createdBy": "8454cb21e79ee6a4-3ce9d79c-4e304236-85b59e05-fade097880d8f754010932d6",
                    "status": "unread",
                    "data": {
                        "groupId": "c59cca34-c574-49ad-953b-c1cfc7ad50a3","actionData": {
                            "actionType": "groupNotify",
                            "title": "Title for Notification",
                            "messagedescription": "Description which will be "You are added to a group. Click here to explore",displayed in Notification",
                            "contentURL": "my-groups/group-details/c59cca34-c574-49ad-953b-c1cfc7ad50a3",
                            "activityIdidentifier": ""
                        }
                    },
                    "createdOn": 16203690237271620626043127
                }
            ]
        }
    }
}

Mark notification as read:

...