Perform Work Item
Accept or reject a work item (approval or activity).
POST https://instance.securid.com/aveksa/command.submit?cmd=performWorkItem
tip
This command replaces the deprecated Perform Approval command. Use this for both approval and activity work items.
Request
Parameters
| performWorkItem | |
approval or activity | |
The action to perform. Retrieve valid values from Get Work Item Details. For example: accept, reject, or Completed. | |
| The ID of the work item. Retrieve from Get Work Items for User. | |
| Comment from the actor. | |
| request-items-to-reject | Comma-separated list of request item IDs to reject. Only valid for partial acceptance of an approval. Cannot be used when action is reject. |
| format |
|
| token | Deprecated. Use the Authorization request header instead. |
Headers
Bearer token | |
| Accept | application/json |
| Content-Type | application/json |
Response
This command does not return output properties on success. A 200 with an empty body indicates the work item was performed.
Examples
Request
- Curl
- Python
- Node.js
curl -K -X POST \
"https://instance.securid.com/aveksa/command.submit?cmd=performWorkItem&format=json&workItemType=approval&action=accept&workItemId=441:WPDS:1&comment=Approved" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json"
import requests
url = "https://instance.securid.com/aveksa/command.submit"
params = {
"cmd": "performWorkItem",
"format": "json",
"workItemType": "approval",
"action": "accept",
"workItemId": "441:WPDS:1",
"comment": "Approved"
}
headers = {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
}
response = requests.post(url, params=params, headers=headers)
if response.status_code == 200:
print("Work item 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: "performWorkItem",
format: "json",
workItemType: "approval",
action: "accept",
workItemId: "441:WPDS:1",
comment: "Approved"
};
const headers = {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
};
axios.post(url, null, { params, headers })
.then(response => {
if (response.status === 200) {
console.log("Work item performed successfully");
} else {
console.log(`Request failed with status code ${response.status}`);
}
})
.catch(error => {
console.error('Error:', error);
});
Response
- 200
- 401 Invalid Token
- 412 Missing workItemType
- 412 Missing action
- 412 Missing workItemId
- 412 Missing comment
- 412 Work Item Not Found
{
"data": {
"type": "performWorkItem"
}
}
<html>
<head>
<title>Error</title>
</head>
<body>The token is not valid for the command 'performWorkItem'. Token is invalid or expired</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The workItemType parameter is required.
Query String=cmd=performWorkItem&format=json&action=accept&workItemId=<id>&comment=ok</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The action parameter is required.
Query String=cmd=performWorkItem&format=json&workItemType=approval&workItemId=<id>&comment=ok</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The workItemId parameter is required.
Query String=cmd=performWorkItem&format=json&workItemType=approval&action=accept&comment=ok</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The comment parameter is required.
Query String=cmd=performWorkItem&format=json&workItemType=approval&action=accept&workItemId=<id></body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The work item could not be retrieved
Query String=cmd=performWorkItem&format=json&workItemType=approval&action=accept&workItemId=<id>&comment=ok</body>
</html>
Verified with RSA Governance & Lifecycle version 8.0.0.188886 P10_HF01.
See Also
- Get Work Items for User: Retrieve work items assigned to a user
- Get Work Item Details: Get valid action values for a work item
- Get Approvals for User: Retrieve pending approvals for a user