Preview the Approval Path
1 min
POST
https://api.nue.io/cpq/approvals:preview
Body Parameters
- bodyPreviewApprovalRequestrequired
- recordIdstringrequiredDescription
- processNamestringDescription
Responses
200
- ApprovalPreviewResponseDescription
- statusstringDescription
- dataApprovalPreviewData
- recordIdstring
- requiresApprovalbooleanDescription
- resolvedProcessNamestringDescription
- pathsApprovalPreviewPath[]
- pathIdstring
- pathNamestring
- willTriggerbooleanDescription
- dependsOnPathIdstring
- stepsApprovalPreviewStep[]
- stepIdstring
- stepNamestring
- stepStatusstringDescription
- triggerReasonstringDescription
- approvalReasonstringDescription
- resolveOnstringDescription
- numberOfApproversinteger
- dependsOnStepIdstringDescription
- isRememberedbooleanDescription
- approversApprovalApprover[]
- approverTypestringDescription
- userIdstringDescription
- namestringDescription
- warningsApprovalMessage[]Description
- severitystringDescription
- codestringDescription
- messagestringDescription
- errorsApprovalMessage[]Description
- severitystringDescription
- codestringDescription
- messagestringDescription
400
- ApprovalActionResponseDescription
- statusstringDescription
- dataApprovalActionData
- requestIdstring
- recordIdstring
- statusstring
- isLockedboolean
- approversApprovalActionItem[]
- approvalIdstring
- stepNamestring
- stepStatusstring
- approverUserIdstring
- originalApproverUserIdstring
- reassignedFromApprovalIdstring
- rejectionMessagestring
- approvalsApprovalActionItem[]
- approvalIdstring
- stepNamestring
- stepStatusstring
- approverUserIdstring
- originalApproverUserIdstring
- reassignedFromApprovalIdstring
- rejectionMessagestring
- warningsApprovalMessage[]Description
- severitystringDescription
- codestringDescription
- messagestringDescription
- errorsApprovalMessage[]Description
- severitystringDescription
- codestringDescription
- messagestringDescription
401
404
429
500
curl
curl --request POST \
--url https://api.nue.io/cpq/approvals:preview \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"recordId": ""
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"recordId": ""
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.nue.io/cpq/approvals:preview", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.nue.io/cpq/approvals:preview")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"recordId": ""
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.nue.io/cpq/approvals:preview"
payload = json.dumps({
"recordId": ""
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Approval routing previewed. Nothing is persisted.
{
"status": "",
"data": {
"recordId": "",
"requiresApproval": false,
"resolvedProcessName": "",
"paths": [
{
"pathId": "",
"pathName": "",
"willTrigger": false,
"dependsOnPathId": "",
"steps": [
{
"stepId": "",
"stepName": "",
"stepStatus": "",
"triggerReason": "",
"approvalReason": "",
"resolveOn": "",
"numberOfApprovers": 0,
"dependsOnStepId": "",
"isRemembered": false,
"approvers": [
{
"approverType": "",
"userId": "",
"name": ""
}
]
}
]
}
]
},
"warnings": [
{
"severity": "",
"code": "",
"message": ""
}
],
"errors": [
{
"severity": "",
"code": "",
"message": ""
}
]
}400
// Missing or invalid parameter.
{
"status": "",
"data": {
"requestId": "",
"recordId": "",
"status": "",
"isLocked": false,
"approvers": [
{
"approvalId": "",
"stepName": "",
"stepStatus": "",
"approverUserId": "",
"originalApproverUserId": "",
"reassignedFromApprovalId": "",
"rejectionMessage": ""
}
],
"approvals": [
{
"approvalId": "",
"stepName": "",
"stepStatus": "",
"approverUserId": "",
"originalApproverUserId": "",
"reassignedFromApprovalId": "",
"rejectionMessage": ""
}
]
},
"warnings": [
{
"severity": "",
"code": "",
"message": ""
}
],
"errors": [
{
"severity": "",
"code": "",
"message": ""
}
]
}401
// Authentication failed or the Salesforce session is unavailable.
404
// Record not found.
429
// Salesforce limit exceeded.
500
// Unexpected or upstream failure.