Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Custom Notification Actions
Before you send a custom notification, you must first create a notification type.
This object is available in API version 46.0 and later.
Supported REST HTTP Methods
URI: /services/data/vXX.X/actions/standard/customNotificationAction
Formats: JSON, XML
HTTP Methods: GET, HEAD, POST
Authentication: Authorization: Bearer token
Inputs
| Input | Type | Description |
|---|---|---|
| actionGroup | string | Optional. Action group for custom notification type. This makes the mobile push notifications actionable. |
| customNotifTypeId | reference | Required. The ID of the Custom Notification Type being used for the notification. |
| recipientIds | reference | Required. The ID of the recipient or recipient type. Valid values are: UserId (sent to this user if active), AccountId (sent to all active Account Team members; requires account teams enabled), OpportunityId (sent to all active Opportunity Team members; requires team selling enabled), GroupId (sent to all active group members), or QueueId (sent to all active queue members). Values can be combined in a list up to 500 values. |
| senderId | reference | Optional. The User ID of the sender of the notification. |
| title | string | Required. The title of the notification, as seen by recipients. Maximum characters: 250. The content of mobile push notifications depends on the content push notification setting. |
| body | string | Required. The body of the notification, as seen by recipients. Maximum characters: 750. The content of mobile push notifications depends on the content push notification setting. |
| targetId | reference | Optional. The Record ID for the target record of the notification. You must specify either a targetID or a targetPageRef. |
| targetPageRef | string | Optional. The PageReference for the navigation target of the notification. To see how to specify the target using JSON, see pageReference. You must specify either a targetID or a targetPageRef. |
Usage
GET
The following example shows how to get information about the custom notification action type:
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/actions/standard/customNotificationAction"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]