Notifications
The SDK lets you manage participant notifications.
Query Notifications
Queries the history of notifications sent to this participant.
MyDataHelps.queryNotifications(queryParameters)
Parameters
sentBefore
date
Filters notifications to those sent before this date.
sentAfter
date
Filters notifications to those sent after this date.
identifier
string
Name of the configured notification.
type
enum
Type of notification. If provided, must be one of Sms
, Push
, or Email
.
statusCode
enum
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.
limit
int
How many entries to include in each page of results. Default and maximum is 100.
pageID
guid
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
Promise<NotificationsPage>
Resolves to a result
object containing a page of notifications.
+ Result Fields
result.notifications
collection
A list of notifications filtered by the query parameters.
+ Element Fields
result.nextPageID
guid
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);
} );
{
"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
}