Analytics Notification

Get information about (GET), save changes to (PUT) or delete (DELETE) a specific analytics notification.

Syntax 

URI: /services/data/vXX.X/analytics/notifications/analytics notification ID

Formats: JSON

HTTP methods

MethodDescription
GETReturns information about a specific notification.
PUTSave changes to the analytics notification as specified in the request body.
DELETEDelete the analytics notification. Deleted notifications can’t be recovered.

Parameters

ParameterDescription
sourceRequired for GET calls. Specifies what type of analytics notification to return. Valid values are:
  • lightningDashboardSubscribe — dashboard subscriptions
  • lightningReportSubscribe — report subscriptions
  • waveNotification — Analytics notifications
ownerIdOptional for GET calls. Allows users with Manage Analytics Notifications permission to get notifications for another user with the specified ownerId.
recordIdOptional. Return notifications for a single record. Valid values are:
  • reportId— Unique report ID
  • lensId— Unique Analytics lens ID

GET Response Body 

PropertyTypeDescription
activeBooleanIndicates whether the notification is being sent (true) or not (false).
configurationWaveConfiguration[]Describes details of a Analytics notification. Only applicable when source is waveNotification.
createdDateDateTimeDate and time when the notification was created (in ISO 8601 format).
deactivateOnTriggerBooleanIndicates whether the notification is deactivated after it’s sent (true) or not (false). Deactivation doesn’t delete the notification. The default value is false.
idStringUnique notification ID.
lastModifiedDateDateTimeDate and time when the notification was last modified (in ISO 8601 format).
nameStringDisplay name of the notification.
recordIdStringUnique ID of the record that the notification describes. Valid values are:
  • reportId
  • lensId
runAsrunAsThe person who runs the report in a report subscription. Report recipients see data in the emailed report that this person has access to in Salesforce. Available in API version 40.0 and later. Only appears if you have the “Subscribe to Reports: Add Recipients” user perm.
scheduleScheduleDetails about the notification’s schedule.
sourceStringIndicates the type of notification. Possible values are:
  • lightningSubscribe — report subscriptions
  • lightningDashboardSubscribe — dashboard subscriptions
  • lightningReportSubscribe — report subscriptions
  • waveNotification — Analytics notifications
thresholdsThreshold[]Specifies what happens when the notification runs. For example, sending an email with report results.

runAs

PropertyTypeDescription
idStringThe person’s unique Salesforce user ID.
nameStringThe person’s first and last name.

Schedule

PropertyTypeDescription
frequencyStringHow frequently the notification is invoked. Possible values are:
  • daily — Every day
  • weekly — One or more days each week
  • monthly — One or more days each month
frequencyTypeStringOnly necessary when frequency is monthly. Possible values are:
  • relative — Days which can change month-to-month, as described by details.
  • specific — Fixed monthly dates, as described by details.
detailsScheduleDetail[]Describes the notification schedule. Varies depending on whether frequency is daily, weekly, or monthly.

ScheduleDetail (frequency is daily)

PropertyTypeDescription
timeIntegerThe hour of the day at which the notification is invoked. Possible values are integers from 0 to 23.

ScheduleDetail (frequency is weekly)

PropertyTypeDescription
timeIntegerThe hour of the day at which the notification is invoked. Possible values are integers from 0 to 23.
daysOfWeekString[]The days of the week on which the notification is invoked. Possible values are:
  • mon — Monday
  • tue — Tuesday
  • wed — Wednesday
  • thu — Thursday
  • fri — Friday
  • sat — Saturday
  • sun — Sunday

ScheduleDetail (frequency is monthly, frequencyType is relative)

PropertyTypeDescription
timeIntegerThe hour of the day at which the notification is invoked. Possible values are integers from 0 to 23.
weekInMonthStringThe week in the month during which the notification is invoked. Possible values are:
  • first — First week
  • second — Second week
  • third — Third week
  • fourth — Fourth week
dayInWeekStringThe day of the week on which the notification is invoked. Possible values are:
  • mon — Monday
  • tue — Tuesday
  • wed — Wednesday
  • thu — Thursday
  • fri — Friday
  • sat — Saturday
  • sun — Sunday
  • weekday — Weekday
  • weekend — Weekend day

ScheduleDetail (frequency is monthly, frequencyType is specific)

PropertyTypeDescription
timeIntegerThe hour of the day at which the notification is invoked. Possible values are integers from 0 to 23.
daysOfMonthInteger[]The days of the month on which the notification is invoked. Possible values are integers from 1 to 31, and -1 (which represents the last day of the month).

Threshold

PropertyTypeDescription
actionsAction[]Specifies what action is taken when the notification is invoked.
conditionsCondition[]Describes conditions that govern when the notification is invoked.
typeStringSpecifies when the notification is invoked (other than date and time criteria). Possible values are:
  • always — Always invoke the notification
  • onError — Invoke the notification when there is an error
  • condition — Invoke the notification based on criteria described by conditions

Condition

PropertyTypeDescription
colNameStringThe data field which is operated on.
valueStringThe comparison value which is used by the operation.
operationStringThe operation which is used to evaluate the condition. Possible values are:
  • equalcolName and value are equal
  • notEqualcolName and value are not equal
  • greaterThancolName is greater than value
  • lessThancolName is less than value
  • greaterThanEqualcolName is greater than or equal to value
  • lessThanEqualcolName is less than or equal to value

Action

PropertyTypeDescription
typeStringThe type of action to perform when the notification is invoked. Possible values are:
  • postToSlack — Post to a Slack channel
  • sendEmail — Send an email to recipients
configurationConfiguration[]Specifies important attributes for resources related to the notification.

Configuration

PropertyTypeDescription
attachmentStringSpecifies whether a Lightning Experience report subscription includes an attachment. If it includes an attachment, also specifies the file attachment. There is only one valid value:
  • excel — Attach report results to the email as a spreadsheet formatted as a .XLSX file. Do not include record-level details in the subscription email.
If the Lightning report subscription does not include an attachment, then the attachment property is not returned. When the attachment property is not returned, HTML-formatted report results are included directly in the subscription email body.
recipientsRecipient[]A list of users, roles, and groups who receive the notification.
summaryOnlyBooleanApplies when threshold type is condition and source=LightningReportSubscribe. If true, emails the notification summary without the report table. If false or null, emails the summary and report table.
teamTeamThe team of notification recipients.

Recipient

PropertyTypeDescription
idStringSpecifies who receives the notification. Valid values are the unique id of a user, role, or group.
displayNameStringThe displayName of the user, role, or group.
typeStringType of recipient. Possible values are:
  • collaborationRoom — A collaboration room.
  • user — A individual user.

Team

PropertyTypeDescription
platformIdStringSpecifies the id of the Slack platform.

WaveConfiguration

PropertyTypeDescription
anchorStringOptional. The Id of the Analytics dashboard widget to which the notification is anchored.
filterStringOptional. Description of selected filters at the time of notification creation.
queryStringRequired. SAQL query which is run when the notification is invoked.
datasetsWaveDataset[]Required. Collection of Analytics datasets referenced by the notification.

WaveDataset

PropertyTypeDescription
idStringRequired. Id of the Analytics dataset.
nameStringOptional. Developer name of the Analytics dataset.
namespaceStringOptional. Namespace of the Analytics dataset.

PUT Request Body 

A notification object with desired changes.

Uses the same format as the GET response body.

PUT Response Body 

An analytics notification object reflecting saved changes.

Uses the same format as the GET response body.

DELETE Response Body 

The analytics notification is deleted, and can’t be recovered.

Returns an empty response body.