Packages API
Packages API enables migrating Business Processes across Control Tower instances.
Request body requirements
If no binary files are transferred, pass the request body in the JSON format:
{
"campaignUuid" : "8f6bd9c9-468f-4c30-9e21-2e942b47d8a5",
"workforceUuid" : "0a0315d0-c917-11e5-81c5-22000bb0e696",
"fileSeparator" : ",",
"mainData" : "colA,colB\r\nvalA1,valB1\r\nvalA2,valB2"
}
Use the following request headers:
Authorization:BasicAccept:application/jsonContent-Type:application/json
The package import feature supports the following conflict resolution types:
CREATE_WITH_NEW_NAMEREPLACE_EXISTINGSKIP_IMPORT
API methods
Authorization is required. For WorkFusion API security requirements, see WorkFusion REST API.
GET methods
/runs/{uuid}/packages
Retrieves a list of existing packages for the specified run.
Parameters: -
Sample request:
curl -i -v -H "Accept: application/json" -H "Content-Type: application/json" --user user:password -X GET https://instance_url/mturk-web/soap/api/runs/621fcab5-9fca-4273-9ae3-3fafdd518f18/packages
/packages/{uuid}/file
Downloads the package based on the specified UUID.
Parameters: -
Sample request:
curl -i -v -H "Accept: application/json" -H "Content-Type: application/json" --user user:password -o package.zip -X GET https://instance_url/mturk-web/soap/api/packages/539905d4-82bf-4ae5-b9ba-428beef49506/file
/runs/{uuid}/data-stores
Retrieves a list of the Data Stores used in the specified run.
Parameters: -
Sample request: -
POST methods
/runs/{uuid}/packages
Creates a new package for the specified run.
Parameters: CreatePackageDto
Sample request:
{"name":"rest-package-name","description":"rest-package-description","dataStoreNames":["test"],"targetVersion":"7.4.1"}
/packages/import
Imports the provided package.
Parameters: packageFile; optional: conflictResolutions (PackageConflictsDto)
curl -H "Content-Type: multipart/form-data" -F "conflictResolutions=@conflicts.json; type=application/json" -F "packageFile=@BP+with+DS+20-6-2016.zip; type=application/octet-stream" -X PUT https://instance_url/mturk-web/soap/api/packages/import -i -v --user user:password conflicts.json: {"dataStoreConflictResolutions":[{"name":"customers_datastore","type":"SKIP_IMPORT"}], "includedConfigsResolutions":[ {"name":"common-functions","type":"REPLACE_EXISTING"}, {"name":"rpa-functions","type":"CREATE_WITH_NEW_NAME","newName":"rpa-functions-v2"} ] }
DELETE method
/packages/{uuid}
Deletes the package based on the specified UUID.
Parameters: -
Sample request: -