Advanced Configuration : Using Integration Manager APIs : Tutorial : Create a Job Configuration
 
Share this page                  
Create a Job Configuration
This section provides steps to create a job configuration. The parameters it accepts and the response codes are documented at https://api.im.actiandatacloud.com/apidocs/#/Job_Configuration/createJobConfig.
This is a POST Request and the URL is http://localhost:8080/api/jobconfigs.
It accepts application/json as content type and Bearer Token as Authorization and this information should be provided in the header.
Request Header
Content-Type: application/json
Authorization: Bearer <access token value>
It accepts the following request body. The mandatory keys that needs to be provided are “name” and “jobTemplateId”. Replace “string” with the configuration name and jobTemplateId respectively. The rest of the keys are optional; either remove them or replace the “string” with valid values or null or empty values.
Request Body
{
    "jobTemplateId": "string",
    "name": "string",
    "schedule": "string",
    "runtimeConfig": {
        "outMessageNames": [
            "string"
        ],
        "logLevel": "SEVERE",
        "packageName": "string",
        "inMessages": [
            {
                "body": "string",
                "name": "string",
                "properties": [
                    {
                        "value": "string",
                        "key": "string"
                    }
                ]
            }
        ],
        "macros": [
            {
                "value": "string",
                "key": "string"
            }
        ],
        "entryPoint": "string",
        "packageArtifactOverride": true,
        "packagePrefix": "string",
        "packageVersion": "string",
        "variables": [
            {
                "value": "string",
                "key": "string"
            }
        ]
    },
    "timeout": 0,
    "active": true,
    "description": "string"
}
If the call is successful, status code 201 Created is returned with the following job configuration response body. You may use the configuration ID that is returned in the body in other job configuration or job execution operations such as creating a file on a job configuration, updating a job configuration, running a job on the job configuration, and so forth.
Sample Response Body for status code: 201
{
    "active": true,
    "created": "Apr 12, 2019 12:40:51 PM",
    "id": "44",
    "lastModified": "Apr 12, 2019 12:40:51 PM",
    "name": "sample config",
    "description": "this is sample config created from API",
    "schedule": "",
    "runtimeConfig": {
        "packageArtifactOverride": false
    },
    "href": "http://localhost:8080/api/jobconfigs/44",
    "user": {
        "id": "1",
        "name": "admin",
        "href": "http://localhost:8080/api/users/1"
    },
    "createdByUser": {
        "id": "1",
        "name": "admin",
        "href": "http://localhost:8080/api/users/1"
    },
    "lastModifiedByUser": {
        "id": "1",
        "name": "admin",
        "href": "http://localhost:8080/api/users/1"
    },
    "template": {
        "id": "12ef65ae-9f7e-47cec3dcd1dfa859",
        "name": "sample template",
        "href": "http://localhost:8080/api/jobtemplates/12ef65ae-9f7e-47cec3dcd1dfa859"
    }
}
If the call fails due to an expired token, status code 401 Unauthorized is returned with the following message. Regenerate the access token by calling /login api and use the new token.
Sample Response Body for status code: 401
{
    "error": "invalid_token",
    "error_description": "Access token expired: <access token value>"
}
If a wrong header or incorrect request body is sent, status code 400 Bad Request is returned.