Get a canon staleness policy
Módulo Canon
GET/canon/staleness-policies/{age_months_gte}canonStalenessPolicies.get
A staleness step: how a price band degrades with age. Returns one canon staleness policy with its `ETag`. A canon staleness policy 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 |
|---|---|---|---|
| age_months_gte | integer | Sí | Age in months at which the action applies.Restricciones: range 0 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_]*)*$ |
Respuesta 200: CanonStalenessPolicy
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| age_months_gte | integer | Sí | Age in months at which the action applies.Restricciones: range 0 to any |
| action | string | Sí | Action taken at that age.Restricciones: pattern ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$ |
| detail | string | null | Sí | Detail of the action.Restricciones: length 1 to 20000 |
{
"age_months_gte": 12,
"action": "degrade",
"detail": "Degrade one step."
}Ejemplos de código
curl -X GET "$XOS_BASE_URL/canon/staleness-policies/12" \
-H "Authorization: Bearer $XOS_API_KEY"const { data, etag } = await xos.canonStalenessPolicies.get("12");response = xos.canon_staleness_policies.get("12")xos canon-staleness-policies get 12