Executing data jobs using a RESTful API

Using RESTful APIs, you can both execute a data job and query the status of existing data jobs. For both requests you need the data pool ID (poolId) and data job ID (jobId) . These can be retrieved from the URL of the respective data jobs, with an example displayed below:

Copy
Copied
[https://[customerdomain].[realm].celonis.cloud/integration/ui/pools/{poolid}/data-configuration/data-jobs?jobId={jobid}](null)

Security

The following bearer and AppKey security settings are available:

Bearer

  • Type : OAuth access token or apiKey.
  • Name : OAuth access token or User-Specific API Key.
  • In : HEADER.

AppKey

  • Type : apiKey
  • Name : Team-Specific application key
  • In : HEADER

Using an OAuth client

If you're using an OAuth client, the following is needed:

  • The scope 'integration.data-pools' must be configured.
  • The client must have both viewing and managing the data pool permissions enabled.
  • To set data pool permissions from your data pool overview page, click Options - Permissions :

Enter image alt description

Executing data jobs

To execute a data job with a RESTful API, you also need to enter the extraction mode:

  • FULL : All tables are extracted.
  • DELTA : Only tables that have changed since the last extraction are included in the task.
Copy
Copied
POST /integration/api/v2/data-pools/{poolId}/data-jobs/{jobId}/execute?mode={mode}

The following is an example of how this API can be used in Python:

Copy
Copied
`import requests` \
 \
`tenant = 'xyz' # the name of your team (your subdomain)` \
`realm = 'xyz' # e.g. eu-1, us-1, eu-2` \
`api_key = 'xyz' # the API key` \
`pool_id = 'xyz' # the Data Pool ID (see above)` \
`data_job_id = 'xyz' # the Data Job ID (see above)url = "https://{}.{}.celonis.cloud/integration/api/v2/data-pools/{}/data-jobs/{}/execute?mode={}".format(tenant, realm, pool_id, data_job_id, data_job_mode)` \
`data_job_mode = 'DELTA' # the mode of the Data Job (see above)` \
 \
`url = "https://{}.{}.celonis.cloud/integration/api/v2/data-pools/{}/data-jobs/{}/execute?mode={}".format(tenant, realm, pool_id, data_job_id, data_job_mode)` \
 \
`requests.post(url, headers={'authorization': "Bearer {}".format(api_key)})`

Querying the status of a data job

After executing a data job, you can query the status of a data job using the following RESTful API:

Copy
Copied
GET /integration/api/pools/{poolId}/jobs/{jobId}