Configure API Calls for Package Automation
To automate package creation, generation, upload, download, and installation, configure REST API calls similar to the examples below. The example code shows generic variables in italics, such as ExampleSessionID, ExampleDescription, and ExampleGuid. When you configure the API calls for your deployment, replace the variables with information specific to your environment and the task you want to automate.
For create, generate, and install API requests, copy the code generated from the Manage Packages page or the Import and Install Packages page in the user interface, which contains package-specific data in place of the example variables. For more information, see Automate Generation and Installation of Packages.
On this page
Create Package
To create a new package, configure an API call similar to the following example.
Request Example
POST http://ExampleWebServerIP/ExampleArcherInstanceName/api/core/package/
Request Header Example
Accept: application/json,text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Authorization: Archer session-id=ExampleSessionID
Content-Type: application/json
Host: localhost
Content-Length: 0
Request Body Example
{"Name":"ExampleName","Description":"ExampleDescription","PreparedBy":"ExamplePreparedByText","PackageObjects": [{"Guid":"ExampleGuid1","Type":"Application"},{"Guid":"ExampleGuid2","Type":"Application"}]
Response Example
{
"Links": [],
"RequestedObject": {"Id": ExampleID},
"IsSuccessful": true,
"ValidationMessages": []
}
Generate Package
To generate a package, configure an API similar to the following example.
Request Example
POST http://ExampleWebServerIP/ExampleArcherInstanceName/api/core/package/generate/ExamplePackageID
Request Header Example
Accept: application/json,text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Authorization: Archer session-id=ExampleSessionID
Content-Type: application/json
Host: localhost
Content-Length: 0
Request Body Example
Not required.
Response Example
{
"Links": [],
"RequestedObject": {},
"IsSuccessful": true,
"ValidationMessages": null
}
Install Package
To install a package, configure an API call similar to the following example.
Request Example
POST http://ExampleWebServerIP/ExampleArcherInstanceName/api/core/package/install
{"PackageId":ExamplePackageID,"InactivateUnusedFields":false,"PrefixInactivatedFields":null,"InstallOptions":[
{"Guid":"ExampleGuid1","Name":"ExampleName1","Type":"Application","TranslationOption":1,"InstallMethod":2,"InstallOption":1},
{"Guid":"ExampleGuid2","Name":"ExampleName2","Type":"Application","TranslationOption":1,"InstallMethod":2,"InstallOption":1},
{"Guid":"ExampleGuid3","Name":"ExampleName3","Type":"GlobalReport","TranslationOption":1,"InstallMethod":2,"InstallOption":1},
{"Guid":"ExampleGuid4","Name":"ExampleName4","Type":"GlobalReport","TranslationOption":1,"InstallMethod":2,"InstallOption":1},
{"Guid":"ExampleGuid5","Name":"ExampleName5","Type":"SubForm","TranslationOption":1,"InstallMethod":2,"InstallOption":1}]}
Request Header Example
Accept: application/json,text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Authorization: Archer session-id=ExampleSessionID
Content-Type: application/json
Host: localhost
Content-Length: 0
Request Body Example
{"Name":"ExampleName","Description":"ExampleDescription","PreparedBy":"ExamplePreparedByText", "PackageObjects":[{"Guid":"ExampleGuid6","Type":"Application"}, {"Guid":"ExampleGuid7","Type":"Application"}]
Response Example
{
"Links": [],
"RequestedObject": {},
"IsSuccessful": true,
"ValidationMessages": null
}
Upload Package
To upload a package, configure an API call similar to the following example.
Request Example
POST http://ExampleWebServerIP/ExampleArcherInstanceName/api/core/package/upload
Request Header Example
Content-Type: multipart/form-data; boundary=-------------------------acebdf13572468
Accept: application/zip,application/json,text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Authorization: Archer session-id=ExampleSessionID
Host: localhost
Content-Length: 2491925
Request Body Example
---------------------------acebdf13572468
Content-Disposition: form-data; name="ExampleFieldName"; filename="ExamplePackageName.zip"
Content-Type: application/zip
<--ExampleFileBytes-->
---------------------------acebdf13572468--
Response Example
{
"Links":[],
"RequestedObject":{"Id":ExamplePackageID},
"IsSuccessful":true,
"ValidationMessages":[]
}
Download Package
To download a package, configure an API call similar to the following example.
Request Example
GET http://ExampleWebServerIP/ExampleArcherInstanceName/api/core/package/download/ExamplePackageID
Request Header Example
Content-Type: application/zip
Authorization: Archer session-id=ExampleSessionID
Request Body Example
Not Required.
Response Example
Response contains the requested package file.