Saltar al contenido

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

measurementMetrics.list: Parámetros de ruta y de consulta
CampoTipoObligatorioDescripción
limitLimitNoPage size. Default 50, maximum 200.Restricciones: range 1 to 200
cursorCursorNoOpaque cursor from `next_cursor` of the previous page.Restricciones: length 1 to any
fieldsFieldsNoSparse 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_]*)*$
sortSortNoSort 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_]*)*$
filterFilterNoFilter 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

measurementMetrics.list: MeasurementMetric
CampoTipoObligatorioDescripción
metric_codestringSí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_codestringSí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_derivedbooleanSíTrue when the figure is computed from the coverage records rather than entered.
lower_boundnumber | nullSíLowest figure accepted, in the base unit.
upper_boundnumber | nullSíHighest figure accepted, in the base unit.
canon_domainstring | nullSíDomain of the benchmarking canon metric.Restricciones: length 1 to 200
canon_itemstring | nullSíItem of the benchmarking canon metric.Restricciones: length 1 to 300
canon_value_numericnumber | nullSíThe canon benchmark as a number.
canon_value_textstring | nullSíThe canon benchmark in words.Restricciones: length 1 to 300
canon_qualifierstring | nullSíQualifier of the canon benchmark.Restricciones: length 1 to 300
ordinalintegerSí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