Notification APIs

Notifiying Users

post

This API is associated with notifying a user on the Sunbird Platform. If the request will contain the mode attribute with value as sms, then the user will be notified via sms else the user will be notified with email. During sms notification you can pass list of phone number or list of phone number and userid both.

  • The /email/ endpoint executes the notification request based on parameters provided as metadata in the request body.
  • It is mandatory to provide values for parameters marked with * .
  • Mandatory fields cannot be null or empty.
Header parameters
AuthorizationstringRequired

To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.

Body
Responses
200
OK ! Successful operation."Notifying User" operation was successfully executed.
application/json
Responseall of

Create Content Response

and
post
POST /api/user/v1/notification/email HTTP/1.1
Host: staging.open-sunbird.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 419

{
  "request": {
    "name": "Amit",
    "subject": "test email",
    "body": "Hello Amit.",
    "downloadUrl": "https://www.google.com/",
    "recipientEmails": [
      "[email protected]",
      "[email protected]"
    ],
    "mode": "sms",
    "recipientPhones": [
      "valid phone number without country code"
    ],
    "recipientUserIds": [
      "valid userId"
    ],
    "recipentSearchQuery": {
      "filters": {
        "channel": "nameof channel",
        "rootOrgId": "rootOrgIds",
        "organisations.roles": [
          "valid roles"
        ]
      }
    }
  }
}
{
  "id": "api.notification.email",
  "ver": "v1",
  "ts": "2020-12-01 10:49:01:948+0000",
  "params": {
    "resmsgid": null,
    "msgid": "12eb0ca45ce4c776fab994d120bedd41",
    "err": null,
    "status": "success",
    "errmsg": "null."
  },
  "responseCode": "OK",
  "result": {
    "response": "SUCCESS"
  }
}

Last updated

Was this helpful?