Core - Notification Preferences
The base url for the APIs in this page is at:
/api/mobile/
A JSON file with OpenAPI data about all core-related mobile APIs can be downloaded here
.
Get Current notification settings
Get a list of the notification settings of the current user (it’s a Paged List APIs, as explained in the introduction):
- GET /v1/user/notifications
Returns a paginated list for the current user’s notification preferences
- Status Codes
200 OK – Success
- POST /v1/user/notifications
Persists the edit of a new or existing notification preference on the user
- Status Codes
200 OK – Success
Returns the list of notification settings for the current user:
[
{
"UserId": 0, // Int
"LastUpdated": "2020-04-07T11:43:50Z", // DateTime
"LastUpdatedBy": "abelcedar.1263@gmail.com", // String
"NotificationType": 0, // Int
"IsEMail": true, // Boolean
"IsSMS": true, // Boolean
"IsPush": true, // Boolean
"ID": 1 // Int
},
...
]
Value types of NotificationType
can be one of the NotificationType enumeration.
If there is a problem in retrieving the current user information or if the user is deleted or disabled, the request will return a 401 Unauthorized Response.
Add new or edit existing notification setting
Adds a new notification setting or edits an existing one for the current user:
- GET /v1/user/notifications
Returns a paginated list for the current user’s notification preferences
- Status Codes
200 OK – Success
- POST /v1/user/notifications
Persists the edit of a new or existing notification preference on the user
- Status Codes
200 OK – Success
The body of the request is the following:
{
ID: 123, // Int
NotificationType: 0, // Int (Required)
IsEmail: true, // Boolean
IsSMS: false, // Boolean
IsPush false // Boolean
}
It is required that at least one between the IsEmail, IsSMS and IsPush field is set to ‘true
Value types of NotificationType
must be one of the NotificationType enumeration.
if ID
(notification preference id) is not provided or set to 0, then the request will create a new record.
The request will return a plain Json positive response if the notification setting has been successfully added or modified, or a plain Json negative response if there was an error while processing the request.
Possible error messages are:
err_InvalidElement
No values provided in the body of the request for the required fields.
err_NoEmailTemplateFound
The field
IsEmail
is set totrue
but no message template has been found for the specifiedNotificationType
for CombinedEmail and SimpleTextEmail formatserr_NoSMSTemplateFound
The field
IsSMS
is set totrue
but no message template has been found for the specifiedNotificationType
for the SMS formaterr_NoEmailSMSTemplateFound
The field
IsEmail
andIsSMS
are set totrue
but no message template has been found for the specifiedNotificationType
for CombinedEmail, SimpleTextEmail and SMS formatserr_NoPushTemplateFound
The field
IsPush
is set totrue
but no message template has been found for the specifiedNotificationType
for PushNotification formaterr_NoEmailPushTemplateFound
The field
IsEmail
and IsPush` are set totrue
but no message template has been found for the specifiedNotificationType
for CombinedEmail, SimpleTextEmail and PushNotification formatserr_NoSMSPushTemplateFound
The field
IsSMS
and IsPush` totrue
but no message template has been found for the specifiedNotificationType
for SMS and PushNotification formatserr_NoNotificationTemplateFound
The three boolean fields are set to
true
but no message template has been found for the specifiedNotificationType
for any of the formats