Skip to main content
POST
/
data
/
export
cURL
curl -X POST "https://apiweb.mile.app/api/v3/data/export?download=xlsx&dataTypeId=6422816ef6710f053056d812&fields=dataId,name,address&limit=100" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
{
  "status": true,
  "message": "Success",
  "total_data_be": 10,
  "last_id": "642282a259c3f74157368012",
  "last_field": "address",
  "data": {
    "time": 1681194657,
    "organizationId": "63d397ca8cb4d07e9d581c82",
    "reportType": "data",
    "link": "https://staticdev.mile.app/dev-mile/20230411/data_63d397ca8cb4d07e9d581c82_1681194657.xlsx",
    "status": "Done"
  }
}

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Query Parameters

download
enum<string>
required

File type that user want to download. There are 2 types of download: enum: json,xlsx Example: xlsx

Available options:
json,
xlsx
background
boolean

If the user sets the background parameter to true, the export process will utilize background processing, and the results will be available at GET /tasks/export-log API. If the user sets the background parameter to false, the export process will run directly, and the results will be immediately available in the response. Example: true. Default: false

fields
string

Fields is for selecting the specific fields that you can choose by multiples to show in the response using a string with a comma delimiter. Example: dataId,name,address

hubId
string

The identifier for the hub that generated by system. Use GET /hubs API to get the list of Hub IDs. Example: 63c63ab1b6972d3150348172

dataTypeId
string

The identifier for the dataType that generated by system. Use GET /data-types API to get the list of dataType IDs. Example: 6422816ef6710f053056d812

page
integer<int32>

Pagination of data result list. Example: 2. Default: 1

limit
integer<int32>

Limit of data result list. Example: 10. Default: 30

sortBy
string

sortBy is used to sort the result-set in ascending or descending order according to selected field. The value of this param is one of available fields on data source objects. Example: name, address, hubId, etc. Default: createdTime

sortOrder
enum<string>

sortOrder is to decide ascending or descending order Example: asc or desc. Default: desc

Available options:
asc,
desc

Response

Success - Export completed or queued

status
boolean

Status of response.

message
string

Message of API response.

total_data_be
integer

Total number of data source records successfully exported.

last_id
string

ID of the last data source record that was successfully exported.

last_field
string

Name of the last field that was successfully exported.

data
object

Export file information.