Perform Approval
Accept or reject an approval work item.
POST https://instance.securid.com/aveksa/command.submit?cmd=performApproval
caution
This command is deprecated and has been replaced by Perform Work Item. Future releases may remove it.
Request
Parameters
| performApproval | |
| format | xml - (Default) Returns the response as XML.json - Returns the response as JSON. |
The action to perform. Valid values match the ActionName values returned by Get Approval Details. Accepted values include accept and Accepted to approve, reject and Rejected to decline. The comparison is case-insensitive. | |
The ID of the approval work item, in id:WPDS:n format. Retrieve this from Get Approvals for User or Find Approvals. | |
| Comment from the approver. Cannot be empty. | |
| request-items-to-reject | Comma-separated list of request item IDs to reject for partial acceptance. Retrieve item IDs from Get Request Items. Cannot be used when action is reject or Rejected. |
Headers
Bearer token |
Response
On success, the server returns 200 with the following body regardless of format.
Examples
Request
- Curl
- Python
- Node.js
curl -K -X POST \
"https://instance.securid.com/aveksa/command.submit?cmd=performApproval&format=json&action=Accepted&approval-id=1001:WPDS:1&comment=Approved" \
-H "Authorization: Bearer <token>"
import requests
url = "https://instance.securid.com/aveksa/command.submit"
params = {
"cmd": "performApproval",
"format": "json",
"action": "Accepted",
"approval-id": "1001:WPDS:1",
"comment": "Approved"
}
headers = {
'Authorization': 'Bearer <token>'
}
response = requests.post(url, params=params, headers=headers)
if response.status_code == 200:
print("Approval performed successfully")
else:
print(f"Request failed with status code {response.status_code}")
const axios = require('axios');
const url = "https://instance.securid.com/aveksa/command.submit";
const params = {
cmd: "performApproval",
format: "json",
action: "Accepted",
"approval-id": "1001:WPDS:1",
comment: "Approved"
};
const headers = {
'Authorization': 'Bearer <token>'
};
axios.post(url, null, { params, headers })
.then(response => {
if (response.status === 200) {
console.log("Approval performed successfully");
} else {
console.log(`Request failed with status code ${response.status}`);
}
})
.catch(error => {
console.error('Error:', error);
});
Response
- 200
- 401 Invalid Token
- 405 Wrong Method
- 412 Missing action
- 412 Missing approval-id
- 412 Missing comment
- 412 Invalid action
- 412 approval-id Not Found
- 412 Not Available
- 412 Reject items with Rejected
{
"data": {
"type": "performApproval"
}
}
<html>
<head>
<title>Error</title>
</head>
<body>The token is not valid for the command 'performApproval'. Token is invalid or expired</body>
</html>
Returned when the request is sent as GET instead of POST.
<html>
<head>
<title>Error</title>
</head>
<body>The command must be executed using a HTTP POST request
Query String=cmd=performApproval&format=json&action=Accepted&approval-id=1001:WPDS:1&comment=Approved</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The action parameter is required.
Query String=cmd=performApproval&format=json&approval-id=1001:WPDS:1&comment=Approved</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The approval-id parameter is required.
Query String=cmd=performApproval&format=json&action=Accepted&comment=Approved</body>
</html>
Returned when comment is absent or an empty string.
<html>
<head>
<title>Error</title>
</head>
<body>The comment parameter is required.
Query String=cmd=performApproval&format=json&action=Accepted&approval-id=1001:WPDS:1</body>
</html>
Returned when the action value does not match any available action on the work item.
<html>
<head>
<title>Error</title>
</head>
<body>No valid button transition could be found on this work item for the action 'bogus'. The workItem cannot be performed via this web service.
Query String=cmd=performApproval&format=json&action=bogus&approval-id=1001:WPDS:1&comment=Approved</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The work item could not be retrieved
Query String=cmd=performApproval&format=json&action=Accepted&approval-id=99999:WPDS:1&comment=Approved</body>
</html>
Returned when the work item is already completed or otherwise not in an actionable state.
<html>
<head>
<title>Error</title>
</head>
<body>The work item is not available for action specified
Query String=cmd=performApproval&format=json&action=Accepted&approval-id=1001:WPDS:1&comment=Approved</body>
</html>
Returned when request-items-to-reject is provided alongside action=reject or action=Rejected.
<html>
<head>
<title>Error</title>
</head>
<body>No request items to reject can be specified when the action is Rejected.
Query String=cmd=performApproval&format=json&action=Rejected&approval-id=1001:WPDS:1&comment=Approved&request-items-to-reject=101</body>
</html>
Verified with RSA Governance & Lifecycle version 8.0.0.188886 P10_HF01.
See Also
- Get Approvals for User: List approval work items for a user
- Find Approvals: Search for approval IDs
- Get Approval Details: Get valid action values for an approval
- Get Request Items: Get request item IDs for partial acceptance
- Perform Work Item: Replacement for this command