Retrieve the current status of a previously submitted data aggregation request.
GET ~/data/:dataSet/:requestId
Headers
Field | Type | Description |
---|---|---|
x-api-key | String |
The hashed API key based on your App's credentials. See Authorisation for more details. |
Parameters
Field | Type | Description |
---|---|---|
:dataSet | String |
The dataset that was requested to be aggregated. Current supported value is orders. |
:requestId | String |
Unique ID identifying this request. |
Response
Field | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
requestId | String |
Unique ID identifying this request. |
||||||||||||
requestCreatedAt | Number/Epoch Unix Time |
The date when the request was received and placed in the queue. The value will be in epoch unix time (in seconds). |
||||||||||||
status | String |
The current state of the request. Can be one of the following:
|
Response (Additional)
Checking the status of completed data aggregation requests will return additional properties in the response payload, outlined below:
Field | Type | Description |
---|---|---|
requestCompletedAt | Number/Epoch Unix Time |
The date when the request was completed and made available for download. The value will be in epoch unix time (in seconds). |
files | Object[] |
The data files produced by the aggregation process. There will be at least one file in the array. |
uri | String |
The URI from where the file is to be downloaded (GET). This endpoint expects valid authentication. Invalid authentication requests will be rejected with a 401 HTTP status code. |
size | Number |
The total size of the file, in kilobytes, after being compressed. |
expires | Number/Epoch Unix Time |
The date at which the file will expire. Expired files will be expunged from the service and will no longer be available for download. The value will be in epoch unix time (in seconds). |
tally | Object |
Provides metrics on the data that was extracted. |
locations | Number |
The total number of locations processed for the requested data aggregation job. |
orders | Number |
The total number of orders, across all locations, processed for the requested data aggregation job. |
transactions | Number |
The total number of transactions, across all locations and orders, processed for the requested data aggregation job. Some orders may have more than one transaction. |
amount | Number |
The total amount (in cents), across all locations, orders and transaction, processed for the requested data aggregation job. Some transaction amounts may have negative values. |
Examples
Request
HTTPS/1.1
GET {API endpoint}/data/orders/e1182944-3b97-4ac3-9839-d1a7b56c2c79
X-API-KEY: {Authorization key}
Content-Type: "application/json"
Response
200
Content-Type: application/json
Content-Length: 77
{
"requestId": "e1182944-3b97-4ac3-9839-d1a7b56c2c79",
"requestCreatedAt": 1539665129,
"status": "pending"
}
Response (with status complete)
200
Content-Type: application/json
Content-Length: 77
{
"requestId": "e1182944-3b97-4ac3-9839-d1a7b56c2c79",
"requestCreatedAt": 1539665129,
"status": "complete",
"requestCompletedAt": 1539665329,
"files": [
{
"uri": "/we23XDs1/e1182944-3b97-4ac3-9839-d1a7b56c2c79/fileName.json.gzip",
"size": 10002,
"expires": 1542933823
}
],
"tally": {
"locations": 1,
"orders": 100,
"transactions": 105,
"amount": 1200
}
}
Comments
0 comments
Please sign in to leave a comment.