Approval API
Call the Advanced Approvals approval resource from an outside source.
| Required Editions |
|---|
| Available in: Advanced Approvals Spring '21 and later |
Invoke the approval API using the following service router call, replacing class with your class name and method with your method name.
ServiceRouter?saver=AA.{class}.{method}
Use the following endpoint.
/services/apexrest/sbaa/ServiceRouter
The approval service accepts the following parameters.
| Parameter | Required | Description |
|---|---|---|
approvalID | Required | ID of the approval record in Salesforce. |
comments | Optional | Comments about the approval. |
Sample Request
Include a saver in the request body model. When you send the approval request, the CPQ service router evaluates the model and finds the saver attribute. It then takes the value of the saver attribute - in this case, Approve - and maps that to the corresponding Advanced Approvals Apex class.
- Header
Content type: application/json
Authorization: Bearer [Access token or session ID]
- Body
Sample CURL Request
This example shows a basic JavaScript function for calling the Approval Service API from Google Sheets.