How to run Jobs Programmatically

Users can send requests to the API to run jobs and schedules programmatically.

Creating a Client ID

First, choose Remote Access from the dropdown menu at the top-right.

Add new API key

Click on Add API Key at the top-right.

Add key button

Provide a description of the key, such as how it will be used.

Choose an expiry date. This API Key will no longer work after this date.

Description and expiry date

Copy the Client ID or Secret.

Client ID and Secret.

You can add firewall rules or your IPv4 address under the Networking tab.

Networking tab

Click Save at the bottom right of this page.

Then choose to add this API Key either to an overall application role in the tenant or in a specific project.

Select a role from the tabs at the top of the page, click Add User, and then choose API Keys as the member type.

Choose user type

Choose an API Key from the dropdown and click Submit.

This API Key will have the permissions of this role.

Choose role

After it has been added, you can use the Client ID of this API Key to access Loome Integrate Online programmatically. The level of access will be the role of the API Key.

API Keys created before the 26th of September 2023 will have the permissions of an administrator. Previously created API Keys that did not have an application role will remain with administrator permissions, but can be modified by you as needed.

If an API Key is deleted, as it is a unique Client ID, you cannot add that same API Key again.

Running a Job Programmatically via Postman

We recommend using Loome’s Postman collection. You can easily generate scripts using the Postman collection in your preferred code language.

Set up Prerequisites

You will need to set up prerequisites to use Loome programmatically.

You can first set up script prerequisites according to our guide here.

You will need to configure a number of variables, such as the IdentityUrl environment variable, IntegrateUrl environment variable, API Key, the environment variable for the IntegrateApiKey, and the IntegrateJobId environment variable.

Currently, we have the following API endpoints in Postman, but these will continue to change in future.

API Endpoints

Please note that these endpoints are subject to change.

Set up a Script using Loome’s Postman Collection

Choose a task on the left panel under Integrate.

(The endpoints your API Key can use will depend on the role you have added it to above.)

Provide any required details in fields such as the URL, Params or Body.

Choose the code format for your preferred language.

Copy the code for your script using the button on the right.

API steps

You can learn more about each API endpoint using the documentation button on the right.

API docs

If you get a Forbidden 403 error, it means your Client ID does not have the required minimum privilege to run the job. Other errors can inform you that the job has failed.

If you receive errors that contain Bad Request and/or Unauthorised 401, this most likely means your Client ID has been removed from the corresponding tenant.

API Endpoint Examples

Run Job

This request can be used to run a job in Loome Integrate.

This endpoint will schedule a job to run by passing the Id of the Job and will return immediately to let you know whether the job scheduling was successful or not.

A successful response does not indicate whether the job ran successfully or not.

Provide the Integrate URL, Integrate Job ID, and API Key.

Provide URL and ID

Choose your code format and copy your code.

Choose code format

Check Job Status

You can see the status of a job using this request.

This request returns the value of a job by the job id.

To check the status, look at the lastExecution.Status value in the json response to determine if the job is in progress or not. You can also see if the last execution succeeded or failed.

If the job has never run, the lastExecution object will be empty, so you should check this first before looking at the status value.

You can use this endpoint to check whether a job is running before you programmatically start a job, or you can also periodically call it to check on a job that you have programmatically started.

Provide the Integrate URL, Integrate Job ID, and API Key.

Provide URL and ID

Choose your code format and copy your code.

Choose code format

Get Schedules

This request will display a list of schedules for a Job in Loome Integrate.

Provide the Integrate URL, Integrate Job ID, and API Key.

Provide URL and ID

Choose your code format and copy your code.

Choose code format

Add or Update Schedule

This request can be used to add a new schedule or update an existing schedule for a Loome Integrate Job.

The name, timeZone, startDate, enabled, and crons fields are all required, while endDate is an optional field. Crons must be an array of one or more crons to run your schedule.

Under Params, provide the Integrate URL, Integrate Job ID, and API Key.

Provide URL and ID

Under Body, provide the details of the schedule.

For example, { “name”: “My Schedule”, “timezone”: “AUS Eastern Standard Time”, “startDate”: “2023-09-04”, “endDate”: null, “enabled”: true, “crons”: [ “0 10 * * *” ] }

Provide schedule

When you are ready, you can then choose your code format on the right and copy your code.

Choose code format

Delete Schedule

This request can be used to delete a schedule for a Loome Integrate Job.

Provide the Integrate URL, Integrate Job ID, Schedule name, and API Key.

Provide URL and ID

Choose your code format and copy your code.

Choose code format