Read analytics catalog
curl --request GET \
--url https://apiweb.mile.app/api/v3/analytics/catalog \
--header 'Authorization: Bearer <token>'import requests
url = "https://apiweb.mile.app/api/v3/analytics/catalog"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apiweb.mile.app/api/v3/analytics/catalog', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/analytics/catalog",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/analytics/catalog"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apiweb.mile.app/api/v3/analytics/catalog")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/analytics/catalog")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"id": "task",
"kind": "builtin",
"label": "data_source.task",
"specVersion": 1,
"timeFieldCandidates": [
"createdTime",
"updatedTime",
"startTime",
"endTime",
"doneTime"
],
"defaultTimeField": "startTime",
"aggregations": {
"measures": {
"count": "supported",
"cardinality": "supported",
"avg": "supported",
"sum": "supported",
"min": "supported",
"max": "supported"
},
"dimensions": {
"terms": "supported",
"dateHistogram": "supported",
"geoGrid": "supported",
"range": "unsupported",
"filters": "unsupported"
}
},
"limits": {
"maxMeasures": 3,
"maxDimensions": 2,
"maxNestingDepth": 2,
"maxBuckets": 5000,
"maxTermsSize": 50,
"maxTermsSizeHardCap": 1000,
"maxTimeRangeDays": 31,
"maxQueriesPerBatch": 12,
"maxRows": 1000,
"queryTimeoutSeconds": 10,
"batchBudgetSeconds": 20,
"tuningStatus": "untuned_defaults"
},
"scope": {
"commonData": false,
"rowLevelSecurity": "none"
},
"requiresBigData": false,
"availability": {
"available": true,
"reason": null,
"description": null
},
"fields": [
{
"name": "status",
"label": "field.task.status",
"optionData": [
"UNASSIGNED",
"ONGOING",
"DONE"
],
"isArray": false,
"unit": null,
"capability": {
"filterable": true,
"groupable": true,
"metricable": false,
"distinctCountable": true,
"timeFieldEligible": false,
"sortable": true
},
"valuePicker": "list",
"valuePickerField": null,
"cardinality": "low",
"fanOut": false,
"availability": {
"available": true,
"blockedReason": null
},
"quality": {
"level": "ok",
"fillRate": null,
"zeroRate": null,
"measuredAt": null,
"sampleSize": null,
"note": null
}
},
{
"name": "travelDuration",
"label": "field.task.travelDuration",
"optionData": null,
"isArray": false,
"unit": "duration",
"capability": {
"filterable": true,
"groupable": false,
"metricable": true,
"distinctCountable": true,
"timeFieldEligible": false,
"sortable": true
},
"valuePicker": "none",
"valuePickerField": null,
"cardinality": "high",
"fanOut": false,
"availability": {
"available": true,
"blockedReason": null
},
"quality": {
"level": "unverified",
"fillRate": null,
"zeroRate": null,
"measuredAt": null,
"sampleSize": null,
"note": "field_quality.unverified"
}
}
]
}
}{
"status": false,
"message": "Unauthenticated.",
"failedCode": "auth-034"
}{
"status": false,
"message": "Access denied. You do not have permission for view dashboard. Please contact your admin to request access.",
"failedCode": "sys-035"
}{
"status": false,
"message": "Unknown data source 'orders'.",
"error": {
"code": "data_source_unknown",
"message": "Unknown data source 'orders'.",
"field": "dataSourceId"
}
}Dashboard
Read analytics catalog
Retrieves the data sources available to analytics queries and their availability for the caller’s organization. With dataSource, returns that source’s full descriptor: time fields, measure functions, dimension kinds, limits, and every field with its capabilities.
GET
/
analytics
/
catalog
Read analytics catalog
curl --request GET \
--url https://apiweb.mile.app/api/v3/analytics/catalog \
--header 'Authorization: Bearer <token>'import requests
url = "https://apiweb.mile.app/api/v3/analytics/catalog"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apiweb.mile.app/api/v3/analytics/catalog', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/analytics/catalog",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/analytics/catalog"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apiweb.mile.app/api/v3/analytics/catalog")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/analytics/catalog")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"id": "task",
"kind": "builtin",
"label": "data_source.task",
"specVersion": 1,
"timeFieldCandidates": [
"createdTime",
"updatedTime",
"startTime",
"endTime",
"doneTime"
],
"defaultTimeField": "startTime",
"aggregations": {
"measures": {
"count": "supported",
"cardinality": "supported",
"avg": "supported",
"sum": "supported",
"min": "supported",
"max": "supported"
},
"dimensions": {
"terms": "supported",
"dateHistogram": "supported",
"geoGrid": "supported",
"range": "unsupported",
"filters": "unsupported"
}
},
"limits": {
"maxMeasures": 3,
"maxDimensions": 2,
"maxNestingDepth": 2,
"maxBuckets": 5000,
"maxTermsSize": 50,
"maxTermsSizeHardCap": 1000,
"maxTimeRangeDays": 31,
"maxQueriesPerBatch": 12,
"maxRows": 1000,
"queryTimeoutSeconds": 10,
"batchBudgetSeconds": 20,
"tuningStatus": "untuned_defaults"
},
"scope": {
"commonData": false,
"rowLevelSecurity": "none"
},
"requiresBigData": false,
"availability": {
"available": true,
"reason": null,
"description": null
},
"fields": [
{
"name": "status",
"label": "field.task.status",
"optionData": [
"UNASSIGNED",
"ONGOING",
"DONE"
],
"isArray": false,
"unit": null,
"capability": {
"filterable": true,
"groupable": true,
"metricable": false,
"distinctCountable": true,
"timeFieldEligible": false,
"sortable": true
},
"valuePicker": "list",
"valuePickerField": null,
"cardinality": "low",
"fanOut": false,
"availability": {
"available": true,
"blockedReason": null
},
"quality": {
"level": "ok",
"fillRate": null,
"zeroRate": null,
"measuredAt": null,
"sampleSize": null,
"note": null
}
},
{
"name": "travelDuration",
"label": "field.task.travelDuration",
"optionData": null,
"isArray": false,
"unit": "duration",
"capability": {
"filterable": true,
"groupable": false,
"metricable": true,
"distinctCountable": true,
"timeFieldEligible": false,
"sortable": true
},
"valuePicker": "none",
"valuePickerField": null,
"cardinality": "high",
"fanOut": false,
"availability": {
"available": true,
"blockedReason": null
},
"quality": {
"level": "unverified",
"fillRate": null,
"zeroRate": null,
"measuredAt": null,
"sampleSize": null,
"note": "field_quality.unverified"
}
}
]
}
}{
"status": false,
"message": "Unauthenticated.",
"failedCode": "auth-034"
}{
"status": false,
"message": "Access denied. You do not have permission for view dashboard. Please contact your admin to request access.",
"failedCode": "sys-035"
}{
"status": false,
"message": "Unknown data source 'orders'.",
"error": {
"code": "data_source_unknown",
"message": "Unknown data source 'orders'.",
"field": "dataSourceId"
}
}Authorizations
Use a valid Bearer token to authenticate.
Query Parameters
task, user, task_detail or a 24-hex id. Omit to list data sources.