Invoking Actions
Most actions are invoked using the same JSON body format. The top-level JSON key name must be inputs.
The following example request shows two Chatter posts made with a single Post to Chatter action.
POST /services/data/vXX.X/actions/standard/chatterPost
{ "inputs" :
[
{
"subjectNameOrId" : "jsmith@salesforce.com",
"type" : "user",
"text" : "first chatter post!"
},
{
"subjectNameOrId" : "hsmith@salesforce.com",
"type" : "user",
"text" : "second chatter post!"
}
]
}
Here is the response.
[ {
"actionName" : "chatterPost",
"errors" : null,
"isSuccess" : true,
"outputValues" : {
"feedItemId" : "0D5D0000000kynqKBA"
}
}, {
"actionName" : "chatterPost",
"errors" : null,
"isSuccess" : true,
"outputValues" : {
"feedItemId" : "0D5D0000000kynrKBz"
}
} ]
Standard actions return their name in actionName. The value of actionName varies for custom actions.
Action | actionName value |
---|---|
Flow | The flow name |
Apex | The class’s invocable method name |
Quick action |
<object name>.<quick action
name> For a global quick action, there’s no <object name>. prefix. |
Email alert | <object name>.<email alert name> |
Send notification | The API name of the notification type |
Generate Prompt Response | The API name of the prompt template |