Get Async-Job Status
A client may use the returned job identifier id to query the progress of the job.
The possible identifiers are:
Entity Error File Example
[
{
"store_number" : 136,
"errors" : ["missing mandatory field : 'store_name'"]
},
{
"store_number" : 15656,
"errors" : ["incorrect value : 'latitude' - expected Number received String"]
}
]
GET Aysnc-Job Status Example
{
"entity_type": "store",
"file_name": "my_file.json"
,
"input_file_url": "https://traxusint.s3.amazonaws.com/integ11/async-jobs/<job-id>/my-file.json",
"number_of_job_items": 1,
"action": "upload",
"mode": "new",
"user_name": "qa-api-user",
"source": "API",
"import_mode": "",
"project": "dev10",
"parsed_file_url": "http://traxus.s3.amazonaws.com/qa-dev10/async-jobs/20161221/1482339694007-store",
"status": "done",
"creation_time": "2022-05-08T08:09:44.202Z",
"tries": 1,
"failure_reason": null,
"complete_time": "2022-05-08T08:09:50.893Z",
"number_of_effected_items": 0,
"number_of_rejected_items": 1,
"rejection_details_url":"https://traxusint.s3.amazonaws.com/qa-dev10/
async-jobs/20161221/12345678-store",
"rejection_details_xlsx_url": "https://traxusint.s3.amazonaws.com/
qa-dev10/async-jobs/20161221/12345678-store_xlsx_errors.xlsx"
}
-
'queued': The async job is pending on the Trax side
-
'in progress': The async job is currently running
-
'done': The async job completed successfully. If there are errors in the processed file they will appear in the rejection_details link/s
-
'failed': The async job was unable to complete. Please retry and if it continues to fail, please contact support
GET /api/:version_number/:project_name/async-job/status/:async-job-id
Supported Protocol: HTTPS
POST Async-Job
Supported Protocol: HTTPS
POST /api/:version_number/:project_name/async-job?uploadType=multipart
Request Details
Mandatory fields marked indicated by
*
POST https://www.services.traxretail.com/api/v4/sample-project/async-job?uploadType=multipart HTTP/1.1
Auth-Token: [YOUR_AUTH_TOKEN]
Content-Type:multipart/form-data; boundary=[YOUR_CUSTOM_BOUNDARY]
Content-Length: [NUMBER_OF_BYTES_IN_ENTIRE_REQUEST_BODY]
----YOUR_CUSTOM_BOUNDARY
Content-Disposition: form-data; name="entity_type"
store
----YOUR_CUSTOM_BOUNDARY
Content-Disposition: form-data; name="file_format"
CSV_ZIP
----YOUR_CUSTOM_BOUNDARY
Content-Disposition: form-data; name="file"; filename="test-csv.zip"
Content-Type: application/gzip
----YOUR_CUSTOM_BOUNDARY
Request Example
Response Details
The Async-Job POST reply body will contain the following fields:
Async Job received
GET 'async-job/status/<async-job-id>' should be used to query the progress of the job with id <async-job-id>. See section below.
-
HTTP Code: 202 Accepted
-
Response Header:
-
Location : '<version_number>/<project_name>/async-job/status/<async-job-id>'
-
Incorrect Request
-
HTTP Code: 400 - Bad Request
-
Error Parsing Request
-
Empty File Received
-
Error Code: 400 - Bad Request
-
Received file is empty
-
Request Headers
Authorization string
Value: 'Auth-Token {project auth token}'
Authentication token provided by Trax
Content-Type string
Value: 'multipart/form-data'
Data type needed for request. If including a custom boundary string for identifying the sections of the request, include here as well
Example:
Content-Type: multipart/form-data;
boundary=<your boundary here>
Content-Length number
The total number of bytes in the request body
Query Parameters
version_number string *
The current implemented API version. <Major> version (e.g. 'v4')
project_name string *
Project name as provided by Trax
Request Body
entity_type string *
Value: 'stores' OR 'user' OR 'routes'
The entity for which this job applies to
file_format string *
Value: 'JSON' OR 'CSV' OR 'CSV_ZIP' OR 'JSON_ZIP'
The expected file format
file FILE*
The actual transmitted file
Mandatory fields marked indicated by
Format the body according to the multipart/form-data content type [https://tools.ietf.org/html/rfc7578], which contains a set of key-value pairs in the following format:
*
Async Jobs
This method should be used to add an asynchronous job to Trax servers, with the request to add/remove/modify entities
Creating, Deleting and Updating entities
Check Status of Submitted Async-Job