Jobs API
- Table of Contents
- Get a List of Background Jobs
Get a List of Background Jobs
URLs
Get background jobs on the current user’s organization
GET /ga/api/v2/jobs/all
GET /ga/api/v2/jobs/unfinished
Get background jobs across all organizations (system admin only)
GET /ga/api/v2/jobs/all_on_all_organizations
GET /ga/api/v2/jobs/unfinished_on_all_organizations
Get background jobs on the specified organization (system admin only)
GET /ga/api/v2/organizations/:organization_id/jobs/all
GET /ga/api/v2/organizations/:organization_id/jobs/unfinished
Request Parameters
begins_at__after string |
Filter results to only jobs whose |
begins_at__before string |
Filter results to only jobs whose |
finished_at__after string |
Filter results to only jobs whose |
finished_at__before string |
Filter results to only jobs whose |
state string |
Filter results to only jobs whose state is one of the values provided. |
job_type string |
Filter results to only jobs whose job_type is one of the values provided. |
Response
This endpoint returns paginated records with a default page size of 2000
.
id integer |
The internal identifier for this background job |
||||||||
mailing_list_id integer |
The mailing list associated with this background job |
||||||||
organization_id integer |
The internal identifier for this background job’s organization |
||||||||
suppression_list_id integer |
The suppression list associated with this background job |
||||||||
state string The current status of this job. State can be one of the following for each
|
|||||||||
state2 string |
Campaigns will have a secondary state, returned here. Can be one of:
|
||||||||
paused boolean |
Whether this job is paused ( |
||||||||
name string |
The name of this job |
||||||||
progress_value integer |
Numerator of the job’s current progress |
||||||||
progress_total integer |
Denominator of the job’s current progress |
||||||||
job_type string |
The type of job represented by this object. |
||||||||
begins_at string |
Scheduled time that this job will begin |
||||||||
started_at string |
The time at which this job began |
||||||||
finished_at string |
The time at which this job finished |
||||||||
created_at string |
The time at which this job was created |
||||||||
retry_at string |
The job hit a failure condition and will retry at this time |
Example
Note that the JSON response will not be “pretty formatted” as it is below.
GET /ga/api/v2/jobs/all_on_all_organizations
HTTP/1.1 200 OK
{
"success": true,
"data": [
{
"begins_at": null,
"created_at": "2017-02-22T17:32:42Z",
"finished_at": "2017-01-22T17:32:42Z",
"id": 28,
"job_type": "SubscriberImport",
"mailing_list_id": 28,
"name": "small-subscriber-file.csv",
"organization_id": 28,
"paused": false,
"progress_total": null,
"progress_value": 0,
"retry_at": null,
"started_at": null,
"state": "finished",
"state2": null,
"suppression_list_id": null,
"updated_at": "2017-02-22T17:32:42Z"
},
{
"begins_at": null,
"created_at": "2017-02-22T17:32:42Z",
"finished_at": "2017-02-15T17:32:42Z",
"id": 29,
"job_type": "SubscriberImport",
"mailing_list_id": 29,
"name": "larger-subscriber-file.csv",
"organization_id": 29,
"paused": false,
"progress_total": null,
"progress_value": 0,
"retry_at": null,
"started_at": null,
"state": "finished",
"state2": null,
"suppression_list_id": null,
"updated_at": "2017-02-22T17:32:42Z"
},
{
"begins_at": null,
"created_at": "2017-02-22T17:32:42Z",
"finished_at": null,
"id": 30,
"job_type": "SubscriberImport",
"mailing_list_id": 30,
"name": "first-import.csv",
"organization_id": 30,
"paused": false,
"progress_total": null,
"progress_value": 0,
"retry_at": null,
"started_at": null,
"state": "importing",
"state2": null,
"suppression_list_id": null,
"updated_at": "2017-02-22T17:32:42Z"
}
],
"error_code": null,
"error_message": null,
"page": 0,
"per_page": 2000,
"num_records": 3,
"num_pages": 1
}