Newer Version Available

This content describes an older version of this product. View Latest

Custom Notification Actions

Send custom notifications to recipients via desktop or mobile channels.

Before you send a custom notification, you must first create a notification type. For more information about notification types, see CustomNotificationType and the CustomNotificationType Tooling object.

This object is available in API version 46.0 and later.

Supported REST HTTP Methods

URI
/vXX.X/actions/standard/customNotificationAction
Formats
JSON, XML
HTTP Methods
GET, HEAD, POST
Authentication
Authorization: Bearer token

Inputs

Input Details
customNotifTypeId
Type
reference
Description
Required. The ID of the Custom Notification Type being used for the notification.
recipientIds
Type
reference
Description
Required. The ID of the recipient or recipient type of the notification. Valid recipient or recipient type values are:
  • UserId — The notification will be sent to this user, if this user is active.
  • AccountId — The notification will be sent to all active users who are members of this account’s Account Team.

    This recipient type is valid if account teams are enabled for your org.

    Note

  • OpportunityId — The notification will be sent to all active users who are members of this opportunity’s Opportunity Team.

    This recipient type is valid if team selling is enabled for your org.

    Note

  • GroupId — The notification will be sent to all active users who are members of this group.
  • QueueId — The notification will be sent to all active users who are members of this queue.
Values can be combined in a list up to the maximum of 500 values.
senderId
Type
reference
Description
Optional. The User ID of the sender of the notification.
title
Type
string
Description
Required. The title of the notification, as it will be seen by recipients. Maximum characters: 250.

The content of mobile push notifications depends on the Display full content push notifications setting.

Note

body
Type
string
Description
Required. The body of the notification, as it will be seen by recipients. Maximum characters: 750.

The content of mobile push notifications depends on the Display full content push notifications setting.

Note

targetId
Type
reference
Description
Required. The Record ID for the target record of the notification.

Usage

GET
The following example shows how to get information about custom notification actions:
1curl --include --request GET \
2--header "Authorization: Authorization: Bearer 00DR...xyz" \
3--header "Content-Type: application/json" \
4"https://instance.salesforce.com/services/data/v46.0/tooling/query"
POST
The following example shows how to create a custom notification action:
1curl --include --request POST \
2--header "Authorization: Authorization: Bearer 00DR...xyz" \
3--header "Content-Type: application/json" \
4--data '{ "inputs" :
5  [
6  {
7    "customNotifTypeId" : "0MLR0000000008eOAA",
8    "recipientIds" : ["005R0000000LSqtIAG"],
9    "title" : "Custom Notification",
10    "body" : "This is a custom notification.",
11    "targetId" : "001R0000003fSUDIA2"
12  }
13  ]
14}' \
15"https://instance.salesforce.com/services/data/v46.0/actions/standard/customNotificationAction"
The response is:
1[
2   {
3      "actionName" : "customNotificationAction",
4      "errors" : null,
5      "isSuccess" : true,
6      "outputValues" : {
7         "SuccessMessage" : "Your custom notification is processed successfully."
8      }
9   }
10]