Notifications
The SDK lets you manage participant notifications.
Query Notifications
Queries the history of notifications sent to this participant.
MyDataHelps.queryNotifications(queryParameters)
Parameters
Filters notifications to those sent before this date.
Filters notifications to those sent after this date.
Name of the configured notification.
Type of notification. If provided, must be one of Sms
, Push
, or Email
.
Describes whether the notification was sent. Must be one of:
Succeeded
: The notification was sent. This does not guarantee it was received nor read.Unsubscribed
: The notification could not be sent because the recipient unsubscribed their contact info from notifications.MissingContactInfo
: The notification could not be sent because contact info was not available.NoRegisteredMobileDevice
: The notification could not be sent because a verified mobile device was not available.NoAssociatedUser
: The notification could not be sent because the participant has not registered an account on MyDataHelps.ServiceError
: The notification was not sent due to an error.
How many entries to include in each page of results. Default and maximum is 100.
Each page of results will return a nextPageID
if there are additional pages that can be queried. Supply that as pageID
to query the next page. When excluded, retrieves the first page.
Returns
Resolves to a result
object containing a page of notifications.
A list of notifications filtered by the query parameters.
Identifier for this notification.
Internal, stable, unique ID for the participant that was sent this notification.
Project-set, unique identifier for the participant that was sent this notification.
Identifier for the notification configuration.
If the notification was sent, the date at which the notification was sent.
Describes whether the notification was sent. Will be one of:
- “Succeeded”: The notification was sent. This does not guarantee it was received nor read.
- “Unsubscribed”: The notification could not be sent because the recipient unsubscribed their contact info from notifications.
- “MissingContactInfo”: The notification could not be sent because contact info was not available.
- “NoRegisteredMobileDevice”: The notification could not be sent because a verified mobile device was not available.
- “NoAssociatedUser”: The notification could not be sent because the participant has not registered an account on MyDataHelps.
- “ServiceError”: The notification was not sent due to an error.
Type of notification. Will be one of “Sms”, “Push”, or “Email”.
An object whose fields depend on the type of the notification.
Sms and Push only. The content of the notification.
Push only. The title of the notification.
Email only. The subject line of the email. The content of the email is not available.
Contains details about the schedule that triggered the notification, if applicable. Will be null if the notification was not triggered by a schedule.
Unique identifier for the schedule.
Schedule name.
User-assigned category for the schedule (optional).
How often the notification is delivered, based on the interval type. For example, if intervalType
is Weeks and interval
is 4, it means the notification repeats every 4 weeks. Will be null if the schedule does not repeat.
Units for interval
. May be Days, Weeks, Months, or Years.
For a notification initiated by a coordinator action, this will record the coordinator’s name and email. Will be null for scheduled notifications.
An ID to be used with subsequent queries. Results from queries using this ID as the pageID
parameter will show the next page of results. This field is null if there isn’t a next page.
Availability
var queryParams = {
sentAfter: "2021-02-15"
};
MyDataHelps.queryNotifications(queryParameters)
.then( function(result) {
console.log(result);
} );
var queryParams = {
sentAfter: "2021-02-15"
};
MyDataHelps.queryNotifications(queryParameters)
.then( function(result) {
console.log(result);
} );
{
"notifications": [
{
"id": "d786f2a6-6c71-eb11-aa81-f8e4e3480e0d",
"participantID": "82320a5b-4d6a-eb11-aa7f-f8e4e3480e0d",
"identifier": "WeeklyUpdate-LateNotification",
"sentDate": "2021-02-17T22:08:31.637+00:00",
"statusCode": "Succeeded",
"type": "Email",
"content": {
"subject": "Weekly Update due date approaching"
},
"sourceUser": null,
"schedule": {
"id": "a843df73-07c2-45a3-9808-98745fafc766",
"name": "Weekly Reminder",
"category": "Phase 1",
"interval": 1,
"intervalType": "Week"
}
}
],
"nextPageID": null
}
{
"notifications": [
{
"id": "d786f2a6-6c71-eb11-aa81-f8e4e3480e0d",
"participantID": "82320a5b-4d6a-eb11-aa7f-f8e4e3480e0d",
"identifier": "WeeklyUpdate-LateNotification",
"sentDate": "2021-02-17T22:08:31.637+00:00",
"statusCode": "Succeeded",
"type": "Email",
"content": {
"subject": "Weekly Update due date approaching"
},
"sourceUser": null,
"schedule": {
"id": "a843df73-07c2-45a3-9808-98745fafc766",
"name": "Weekly Reminder",
"category": "Phase 1",
"interval": 1,
"intervalType": "Week"
}
}
],
"nextPageID": null
}