Users can send requests to the API to run jobs and schedules programmatically.
First, choose Remote Access from the dropdown menu at the top-right.
Click on Add API Key at the top-right.
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.
Copy the Client ID or Secret.
You can add firewall rules or your IPv4 address under the 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 an API Key from the dropdown and click Submit.
This API Key will have the permissions of this 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.
If an API Key is deleted, as it is a unique Client ID, you cannot add that same API Key again.
We advise that you check our Postman collection. You can easily generate PowerShell scripts using the Postman collection.
You can first set up script prerequisites according to our guide here. You will need to configure a few details such as the IdentityUrl environment variable, IntegrateUrl environment variable, API Key, the environment variable for the IntegrateApiKey, and the IntegrateJobId environment variable.
We have prepared API endpoints to: - Run Job - Check Job Status - Get Schedules - Add or Update Schedule - Delete Schedule
You can choose a task, provide the required details, choose the code format and then copy the code for your PowerShell script. The endpoints your API Key can use will depend on the role you have added it to above.
You can learn more about each API endpoint using the documentation button on the right.
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.
Choose your code format and copy and paste the code into the Powershell Command-line window.
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.
Choose your code format and copy and paste the code into the Powershell Command-line window.
This request will display a list of schedules for a Job in Loome Integrate.
Provide the Integrate URL, Integrate Job ID, and API Key.
Choose your code format and copy and paste the code into the Powershell Command-line window.
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.
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 * * *” ] }
When you are ready, you can then choose your code format on the right and copy and paste the code into the Powershell Command-line window.
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.
Choose your code format and copy and paste the code into the Powershell Command-line window.
Run the script you copied above by pasting it into a new .PS1
file or a Powershell Command-line window (with ctrl-v).
In PowerShell, you can provide the earlier generated code for running a job.
Next, select a project from the list provided by typing the Project ID number.
Then you go on to select a Job by typing in the number, which is the Job ID, beside the Job you would like to run.
It will then let you know if it was successful in queueing the Job for execution and notify you of its current status.
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.