Newer Version Available
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 | Details |
|---|---|
| customNotifTypeId |
|
| recipientIds |
|
| senderId |
|
| title |
|
| body |
|
| targetId |
You must specify either a targetID or a targetPageRef. |
| targetPageRef |
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:
POST1curl --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"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]