Articles in this section

Jobs API endpoints

download.svg​​ Download Postman collection

Understand and manage your running flows

Job API endpoints

Relative URI

Method

Success Code

Description

/jobs

GET

200

Get all jobs. The following query parameters are supported: _integrationId, _exportId, _importId, _flowId, _flowJobId, _flowId_in, createdAt_lte, createdAt_gte, status, numSuccess_lte, numSuccess_gte, numIgnore_lte, numIgnore_gte, type, and type_in

/jobs/<_id>

GET

200

Get a specific job.

Job API examples

Get all jobs where type is "import" and status is "running"

GET /v1/jobs?type=import&status=running HTTP/1.1
Host: api.integrator.io
Authorization: Bearer my_api_token

Sample response

[
    {
        "_id":"59ee8f9503785d04d846a88e",
        "type":"import",
        "_importId":"537d1ff57ab1870200000002",
        "_flowJobId":"59ee8f80e41d93365ef1b9a9",
        "startedAt":"2017-10-24T00:55:49.128Z",
        "status":"running",
        "numError":0,
        "numSuccess":1,
        "numIgnore":0,
        "numPagesProcessed":1,
        "oIndex":1,
        "retriable":false,
        "createdAt":"2017-10-24T00:55:49.128Z",
        "lastModified":"2017-10-24T00:55:49.642Z"
    }
]

Job API paging

While the Jobs API endpoint doesn’t have an official paging mechanism, you can pass several parameters to mimic a paging scheme. After you call the endpoint, it returns 1000 results in descending order based on the createdAt field. To get the next 1000 records, use the createdAt value from the last record in the first set and subtract 1 millisecond. Then, compare that as a parameter in your subsequent calls against the createdAt_lte field.

Export type of “All”

Relative URI: /v1/jobs

This allows you to get all jobs.

Screenshot 2023-09-27 214735.png

Paging Method: Custom relative URI Override relative URI for subsequent page requests: /v1/jobs?createdAt_lte={{{dateAdd previous_page.last_record.createdAt '-1'}}}

This allows you to get all previous jobs within your accounts retention policy.

Screenshot 2023-09-27 214827 (1).png

Export type of “Delta”

Relative URI: /v1/jobs?createdAt_gte={{lastExportDateTime}}

This allows you to get all jobs created since the last export.

Screenshot 2023-09-27 214901.png

Paging Method: Custom relative URI

Override relative URI for subsequent page requests: /v1/jobs?createdAt_lte={{{dateAdd previous_page.last_record.createdAt '-1'}}}&createdAt_gte={{{lastExportDateTime}}}

This allows you to get all previous jobs created since the last export that fall within your accounts retention policy.

Screenshot 2023-09-27 215036.png
Was this article helpful?
2 out of 2 found this helpful

Comments

0 comments

Please sign in to leave a comment.