13.07.2015 Views

Database.com REST API Developer's Guide - Salesforce.com

Database.com REST API Developer's Guide - Salesforce.com

Database.com REST API Developer's Guide - Salesforce.com

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Using <strong>REST</strong> <strong>API</strong> ResourcesSubmit a Record for ApprovalExample request bodynone requiredExample JSON response body{}"approvals" : {"Account" : [ {"description" : null,"id" : "04aD00000008Py9","name" : "Account Approval Process","object" : "Account","sortOrder" : 1} ]}Submit a Record for ApprovalUse the Process Approvals resource to submit a record or a collection of records for approval. Each call takes an array ofrequests. The entity must support an approval process and an approval process must have already been defined.Example usagecurl https://na1.salesforce.<strong>com</strong>/services/data/v30.0/process/approvals/ -H "Authorization:Bearer token" -H "Content-Type: application/json" -d @submit.json"Example request body submit.json file{}"requests" : [{"actionType" : "Submit","contextId" : "001D000000I8mIm","nextApproverIds" : ["005D00000015rY9"],"<strong>com</strong>ments" : " this is a test"}]Example JSON response body[ {"actorIds" : [ "005D00000015rY9IAI" ],"entityId" : "001D000000I8mImIAJ","errors" : null,"instanceId" : "04gD0000000Cvm5IAC","instanceStatus" : "Pending","newWorkitemIds" : [ "04iD0000000Cw6SIAS" ],"success" : true } ]Approve a RecordUse the Process Approvals resource to approve a record or a collection of records. Each call takes an array of requests. Thecurrent user must be an assigned approver.48

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!