Advanced Configuration : Using Integration Manager APIs : Tutorial : Upload a Package to the Job Configuration
 
Share this page                  
Upload a Package to the Job Configuration
This section provides steps to create a new file on the job configuration. In the next section, we will look at updating the configuration with the package name and the entry point. The parameters it accepts and the response codes are documented at https://api.im.actiandatacloud.com/apidocs/#/Job_Configuration/createJobTemplateFile.
This is a POST Request and the URL is http://localhost:8080/api/jobconfigs/<id>/files. Replace <id> with the configuration ID that you want to upload the package to.
It accepts multipart/form-data as content type and Bearer Token as Authorization, and this information should be provided in the header.
Sample Header
Content-Type: multipart/form-data
Authorization: Bearer <access token value>
It accepts the parameters id, key, and file. Provide the job configuration ID, package file name, and the package file respectively to the parameters; these are mandatory.
Sample Request – code snippet
POST /api/jobconfigs/44/files HTTP/1.1
Host: localhost:8080
Authorization: Bearer <access token value>
Content-Type: multipart/form-data;
key=packageA.djar
file="C:\packages\packageA.djar"
If the call is successful, status code 201 Created is returned with the following job configuration response body.
Sample Response Body for status code: 201
{
    "name": "packageA.djar",
    "href": "http://localhost:8080/api/jobconfigs/44/files/packageA.djar",
    "metadata": {
        "size": 5732,
        "lastModified": "Apr 12, 2019 1:32:52 PM"
    }
}
If the call fails due to expired token or invalid token, status code 401 Unauthorized is returned with an appropriate message.
If a wrong header or incorrect request body is sent, status code 400 Bad Request is returned.