Get a canon metric
Módulo Canon
GET/canon/metrics/{item}canonMetrics.get
A metric, often code-derived and jurisdiction-bound. Returns one canon metric with its `ETag`. A canon metric the caller may not see returns 404.
- Requiere la capacidad canon.taxonomy.read.
- Alcances de OAuth: canon.
- Estados de error: 400, 401, 404, 429. Los errores son detalles de problema RFC 9457.
Parámetros de ruta y de consulta
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| item | string | Sí | Metric item.Restricciones: length 1 to 200 |
| 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_]*)*$ |
Respuesta 200: CanonMetric
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| domain | string | Sí | Metric domain.Restricciones: pattern ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$ |
| item | string | Sí | Metric item.Restricciones: length 1 to 200 |
| value_numeric | number | null | Sí | Metric value. |
| qualifier | string | null | Sí | Qualifier of the value: the code section or modelling note it follows.Restricciones: length 1 to 1000 |
| source | string | null | Sí | Source of the value.Restricciones: length 1 to 300 |
| is_code_derived | boolean | Sí | Whether the value comes from a code. |
| jurisdiction_id | JurisdictionId | Sí | Jurisdiction identifier from `xpms.dim_jurisdiction`. An unpopulated jurisdiction returns no answer.Restricciones: pattern ^[A-Z]{2}(-[A-Z0-9]+)*$ |
| is_jurisdiction_neutral | boolean | Sí | Whether the value holds in every jurisdiction. |
| provenance | Provenance | Sí | Provenance from `xpms.dim_provenance` (Section 3.8); a lower rank never overwrites a higher one.Restricciones: pattern ^[a-z]+$ |
| value_text | string | null | Sí | Value as text, when canon states it in words.Restricciones: length 1 to 300 |
{
"domain": "capacity",
"item": "Stage or performance area",
"value_numeric": 15,
"qualifier": "IBC 1005.3.2 - 0.2 in per occupant",
"source": "IBC 1004.5",
"is_code_derived": true,
"jurisdiction_id": "US-FL",
"is_jurisdiction_neutral": false,
"provenance": "operator",
"value_text": "Per show day"
}Ejemplos de código
curl -X GET "$XOS_BASE_URL/canon/metrics/Stage%20or%20performance%20area" \
-H "Authorization: Bearer $XOS_API_KEY"const { data, etag } = await xos.canonMetrics.get("Stage or performance area");response = xos.canon_metrics.get("Stage or performance area")xos canon-metrics get Stage or performance area