Import Workflow
Import a workflow archive file sent as the request body.
POST https://instance.securid.com/aveksa/command.submit?cmd=importWorkflow
Request
Parameters
| importWorkflow | |
| format | properties - (Default) Returns the response as key=value pairs.json - Returns the response as JSON. |
| filename | The filename in the import directory on the G&L server. The import directory is specified on the Web Services configuration page. Not recommended. Send the file as the request body instead. |
| overwrite | true - Overwrite existing objects.false - (Default) Skip existing objects. |
Headers
Bearer token | |
| Accept | application/json |
| Content-Type | application/octet-stream |
Body
The workflow archive file as binary data. The file must be a valid workflow ZIP archive exported from RSA G&L (Admin > Configuration > Workflow > Export).
Response
Parameters
type | Executed command name |
status | success or failure |
message | Result message. Includes the start timestamp on success, or a failure reason on error. |
Examples
Request
- Curl
- Python
- Node.js
curl -K -X POST \
"https://instance.securid.com/aveksa/command.submit?cmd=importWorkflow&format=json&overwrite=true" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/octet-stream" \
--data-binary "@/path/to/workflow-archive.zip"
import requests
url = "https://instance.securid.com/aveksa/command.submit"
params = {
"cmd": "importWorkflow",
"format": "json",
"overwrite": "true"
}
headers = {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/octet-stream'
}
with open("/path/to/workflow-archive.zip", "rb") as f:
response = requests.post(url, data=f, params=params, headers=headers)
if response.status_code == 200:
print(response.json())
else:
print(f"Request failed with status code {response.status_code}")
const axios = require('axios');
const fs = require('fs');
const url = "https://instance.securid.com/aveksa/command.submit";
const params = {
cmd: "importWorkflow",
format: "json",
overwrite: "true"
};
const headers = {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/octet-stream'
};
const fileData = fs.readFileSync("/path/to/workflow-archive.zip");
axios.post(url, fileData, { params, headers })
.then(response => {
if (response.status === 200) {
console.log(response.data);
} else {
console.log(`Request failed with status code ${response.status}`);
}
})
.catch(error => {
console.error('Error:', error);
});
Response
- 200 Success
- 200 Failure
- 412 Filename Config
- 401 Invalid Token
- 401 No Token
{
"data": {
"type": "importWorkflow",
"status": "success",
"message": "Import started..."
}
}
Returned when the archive file is missing or not a valid workflow ZIP. The HTTP status is still 200. Check status in the response body.
{
"data": {
"type": "importWorkflow",
"status": "failure",
"message": "The workflow import using the archive file /tmp/wfarchive<id>.tmp failed"
}
}
Returned when filename is used but no import directory is configured on the Web Services settings page.
<html>
<head>
<title>Error</title>
</head>
<body>The filename parameter cannot be used until the import directory is configured in the Web Services configuration screen.
Query String=cmd=importWorkflow&format=json&filename=workflow.zip</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The token is not valid for the command 'importWorkflow'. Token is invalid or expired</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The token is required for the command 'importWorkflow'</body>
</html>
Verified with RSA Governance & Lifecycle version 8.0.0.188886 P10_HF01.