Newer Version Available

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

Submit a Record for Approval

Use the Process Approvals resource to submit a record or a collection of records for approval. Each call takes an array of requests. The entity must support an approval process and an approval process must have already been defined.

Example usage
1curl https://na1.salesforce.com/services/data/v30.0/process/approvals/ -H "Authorization: Bearer token" -H "Content-Type: application/json" -d @submit.json"
Example request body submit.json file

In the following example, the record "001D000000I8mIm" is submitted for approval process "PTO_Request_Process" by skipping its entry criteria on behalf of submitter "005D00000015rZy."

1{
2"requests" : [{
3"actionType": "Submit",
4"contextId": "001D000000I8mIm",
5"nextApproverIds": ["005D00000015rY9"],
6"comments":"this is a test",
7"contextActorId": "005D00000015rZy",
8"processDefinitionNameOrId" : "PTO_Request_Process",
9"skipEntryCriteria": "true"}]
10}
Example JSON response body
1[ { 
2  "actorIds" : [ "005D00000015rY9IAI" ],
3   "entityId" : "001D000000I8mImIAJ",
4   "errors" : null,
5   "instanceId" : "04gD0000000Cvm5IAC",
6   "instanceStatus" : "Pending",
7   "newWorkitemIds" : [ "04iD0000000Cw6SIAS" ],
8   "success" : true } ]