List metrics
Lists every metric id an export can request, with its label.
GET
https://mta.growthdept.ai/api/v1/exports/metricsRequest#
Request
curl "https://mta.growthdept.ai/api/v1/exports/metrics" \
-H "Authorization: $MTA_API_KEY" \
-H "Data-Client-ID: $MTA_BRAND_ID"Response#
Response 200 (the first 3 of 537 entries)
{
"metrics": [
{ "id": "allTouchpointsPerOrder", "label": "Touchpoints (All, All)" },
{ "id": "allTouchpointsPerOrderNew", "label": "Touchpoints (All, New)" },
{
"id": "allTouchpointsPerOrderReturning",
"label": "Touchpoints (All, Returning)"
}
]
}Authentication#
Send the API key in Authorization and the brand id in Data-Client-ID. The key needs the export:read scope. See Authentication.
| Header | Type | Description |
|---|---|---|
Authorizationrequired | string | The API key. See Authentication. |
Data-Client-IDrequired | uuid | The brand id. |
Response fields#
| Field | Type | Description |
|---|---|---|
metrics[]. | string | The id to send in metrics[].id. |
metrics[]. | string or null | The metric's label. 9 ids have none. |
Status codes#
| Status | Meaning | Body |
|---|---|---|
| 200 | The list, as above. | |
| 401 | No key, an unknown or revoked key, or a key that belongs to another brand than Data-Client-ID. | { "detail": "Unauthorized: send a valid API key in Authorization and its brand id in Data-Client-ID." } |
| 403 | The key is valid but lacks export:read. | { "detail": "This API key lacks the export:read scope." } |
| 429 | More than 100 requests in one second from this key. Wait the seconds in Retry-After. | { "detail": "Rate limit exceeded: 100 requests per second per API key. Retry after 1 seconds." } |
| 500 | Something failed on our side. Retry later. | { "detail": "Internal server error." } |
What the list covers#
The list is the same for every brand: 537 ids, of which 331 carry data. The other 206 are accepted and export as empty columns, and the export result's warn names them.
The label is not the CSV header. A metric's column in an export file is headed by its column name, such as attributed_revenue for revAttributed, unless your request gives it a label.
Metrics lists every id with its column, format, accounting mode, and whether it carries data.
Questions about the API: support@growthdept.ai.