Notification APIs
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
400
BAD REQUEST. The "Notifying User" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.
application/json
500
'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at [email protected].'
application/json
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?