List measurement metric rows
Módulo Projects
GET/measurement-metricsmeasurementMetrics.list
A figure a project measures against its gate 1 objectives (Section 4.10): sustainability, audience, earned media or sentiment. Canon's metric table holds reference values, so each metric names the canon metric that benchmarks it where canon states one. Returns a cursor page of measurement metric rows the caller may see. The default order is `ordinal` ascending. Supports sparse fieldsets and the filter grammar.
- Requiere la capacidad projects.gate.read.
- Alcances de OAuth: projects.
- Paginación por cursor: se aplican limit, cursor, fields, sort y filter.
- Estados de error: 400, 401, 429. Los errores son detalles de problema RFC 9457.
Parámetros de ruta y de consulta
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| limit | Limit | No | Page size. Default 50, maximum 200.Restricciones: range 1 to 200 |
| cursor | Cursor | No | Opaque cursor from `next_cursor` of the previous page.Restricciones: length 1 to any |
| fields | Fields | No | Sparse fieldset: a comma-separated list of top-level fields to return. `id` is always returned.Restricciones: pattern ^[a-z_][a-z0-9_]*(,[a-z_][a-z0-9_]*)*$ |
| sort | Sort | No | Sort keys, comma-separated; a leading `-` sorts descending. Without `sort`, the documented default order applies (coded lists sort in numeric code order).Restricciones: pattern ^-?[a-z_][a-z0-9_]*(,-?[a-z_][a-z0-9_]*)*$ |
| filter | Filter | No | Filter grammar `filter[field][op]=value`. Operators: eq, ne, lt, lte, gt, gte, in (comma-separated values), is_null (true or false) and contains. Conditions combine with AND. |
Respuesta 200: una página de MeasurementMetric
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| metric_code | string | Sí | Metric (app.measurement_metrics).Restricciones: pattern ^[a-z][a-z0-9_]*$ |
| family | "Sustainability" | "Audience" | "Earned Media" | "Sentiment" | Sí | Family of the figure. |
| dimension | "Mass" | "Volume" | "Energy" | "Emissions" | "Count" | "Percent" | Sí | Dimension of the figure. |
| base_unit_code | string | Sí | Unit totals and comparisons are computed in.Restricciones: pattern ^[a-z][a-z0-9_]*$ |
| aggregation | "Sum" | "Latest" | Sí | How a project's figures combine: each adds to the total (Sum) or the latest measured one stands (Latest). |
| is_derived | boolean | Sí | True when the figure is computed from the coverage records rather than entered. |
| lower_bound | number | null | Sí | Lowest figure accepted, in the base unit. |
| upper_bound | number | null | Sí | Highest figure accepted, in the base unit. |
| canon_domain | string | null | Sí | Domain of the benchmarking canon metric.Restricciones: length 1 to 200 |
| canon_item | string | null | Sí | Item of the benchmarking canon metric.Restricciones: length 1 to 300 |
| canon_value_numeric | number | null | Sí | The canon benchmark as a number. |
| canon_value_text | string | null | Sí | The canon benchmark in words.Restricciones: length 1 to 300 |
| canon_qualifier | string | null | Sí | Qualifier of the canon benchmark.Restricciones: length 1 to 300 |
| ordinal | integer | Sí | Display order.Restricciones: range 1 to any |
{
"data": [
{
"metric_code": "waste_generated",
"family": "Sustainability",
"dimension": "Mass",
"base_unit_code": "kg",
"aggregation": "Sum",
"is_derived": false,
"lower_bound": 0,
"upper_bound": 100,
"canon_domain": "site_services",
"canon_item": "Waste lbs per guest per day",
"canon_value_numeric": 2.4,
"canon_value_text": "1.9 kW continuous",
"canon_qualifier": "MODELED event avg",
"ordinal": 1
}
],
"next_cursor": null
}Ejemplos de código
curl -X GET "$XOS_BASE_URL/measurement-metrics" \
-H "Authorization: Bearer $XOS_API_KEY"for await (const row of xos.measurementMetrics.listAll()) {
console.log(row);
}for row in xos.measurement_metrics.list_all():
print(row)xos measurement-metrics list --all