Get a canon locale
Canon module
GET/canon/locales/{locale_code}canonLocales.get
A supported locale. Returns one canon locale with its `ETag`. A canon locale the caller may not see returns 404.
- Requires the capability canon.taxonomy.read.
- OAuth scopes: canon.
- Error statuses: 400, 401, 404, 429. Errors are RFC 9457 problem details.
Path and query parameters
| Field | Type | Required | Description |
|---|---|---|---|
| locale_code | string | Yes | BCP 47 locale tag.Constraints: pattern ^[a-z]{2,3}(-[A-Z]{2})?$ |
| fields | Fields | No | Sparse fieldset: a comma-separated list of top-level fields to return. `id` is always returned.Constraints: pattern ^[a-z_][a-z0-9_]*(,[a-z_][a-z0-9_]*)*$ |
Response 200: CanonLocale
| Field | Type | Required | Description |
|---|---|---|---|
| locale_code | string | Yes | BCP 47 locale tag.Constraints: pattern ^[a-z]{2,3}(-[A-Z]{2})?$ |
| name | string | Yes | Locale name.Constraints: length 1 to 200 |
| is_source | boolean | Yes | True for the source locale, en-US. |
| release_stage | "general" | "beta" | Yes | Release stage. |
{
"locale_code": "en-US",
"name": "English (United States)",
"is_source": true,
"release_stage": "general"
}Code samples
curl -X GET "$XOS_BASE_URL/canon/locales/en-US" \
-H "Authorization: Bearer $XOS_API_KEY"const { data, etag } = await xos.canonLocales.get("en-US");response = xos.canon_locales.get("en-US")xos canon-locales get en-US