Skip to main content

Hierarchy API- retrieve localized content

Release date: 28th May 2025

The Hierarchy API was introduced to allow you to get all the nodes at all levels of a hierarchy, and easily retrieve all descendants of a specified node. The API now supports the locale parameter to allow you to retrieve hierarchy nodes with content localized for a particular locale.

Using the Hierarchy API with locales
Link copied!

A simple site menu hierarchy, with field level localized string fields for the name and description, is shown below. We've entered values for the en-GB, fr-FR and de-DE locales.

A hierarchy with field level localized content

To retrieve content for the fr-FR locale to 3 levels of the hierarchy, add the locale parameter to the request and specify the fr-FR locale:

https://ampproduct-doc.cdn.content.amplience.net/content/hierarchies/descendants/id/cc0d019a-2870-4abd-a3b5-3a872ddc720b?hierarchyDepth=3&locale=fr-FR

The response is shown below:

{
"responses":[
{
"content":{
"_meta":{
"schema":"https://example.com/site-menu-localized",
"name":"Electricals",
"deliveryId":"0cc3c24e-f58b-4db9-b701-f83f333be8fb",
"hierarchy":{
"parentId":"cc0d019a-2870-4abd-a3b5-3a872ddc720b",
"root":false,
"position":"\"M&s8O~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
}
},
"description":"Articles électriques",
"title":"Electricité"
}
},
{
"content":{
"_meta":{
"schema":"https://example.com/site-menu-localized",
"name":"Computers and tablets",
"deliveryId":"da49909c-56d5-44c3-acad-283b5f5a5c3f",
"hierarchy":{
"parentId":"0cc3c24e-f58b-4db9-b701-f83f333be8fb",
"root":false,
"position":"O~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
}
},
"title":"Ordinateurs et tablettes",
"description":"Ordinateurs et tablettes"
}
},
{
"content":{
"_meta":{
"schema":"https://example.com/site-menu-localized",
"name":"Personal care",
"deliveryId":"eb32bae4-81fc-4692-bf43-0aef1edf75db",
"hierarchy":{
"parentId":"0cc3c24e-f58b-4db9-b701-f83f333be8fb",
"root":false,
"position":"[gO~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
}
},
"title":"Soins personnels",
"description":"Articles de soins personnels"
}
},
{
"content":{
"_meta":{
"schema":"https://example.com/site-menu-localized",
"name":"Home electricals",
"deliveryId":"fcf773da-cda3-410f-bb98-a744d421025c",
"hierarchy":{
"parentId":"0cc3c24e-f58b-4db9-b701-f83f333be8fb",
"root":false,
"position":"gO~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
}
},
"title":"Électricité domestique",
"description":"Téléviseurs, réfrigérateurs et fours"
}
},
{
"content":{
"_meta":{
"schema":"https://example.com/site-menu-localized",
"name":"Blog",
"deliveryId":"b6cb4944-ce01-4721-a6f3-e2eb5050f256",
"hierarchy":{
"parentId":"cc0d019a-2870-4abd-a3b5-3a872ddc720b",
"root":false,
"position":"#4)mD8O~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
}
},
"title":"Blog",
"description":"Blog guide d'achat"
}
},
{
"content":{
"_meta":{
"schema":"https://example.com/site-menu-localized",
"name":"Menswear",
"deliveryId":"8024b801-4258-418e-aad7-691a04bd9722",
"hierarchy":{
"parentId":"cc0d019a-2870-4abd-a3b5-3a872ddc720b",
"root":false,
"position":"#VZ;J,gO~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
}
},
"title":"Vêtements pour hommes",
"description":"Chemises, vestes et pantalons pour hommes"
}
},
{
"content":{
"_meta":{
"schema":"https://example.com/site-menu-localized",
"name":"New arrivals",
"deliveryId":"95918518-f1ab-4830-8da9-0874491aefc0",
"hierarchy":{
"parentId":"cc0d019a-2870-4abd-a3b5-3a872ddc720b",
"root":false,
"position":"#grQM&s8O~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
}
},
"title":"Nouveaux arrivants",
"description":"Nouveaux produits"
}
},
{
"content":{
"_meta":{
"schema":"https://example.com/site-menu-localized",
"name":"Womenswear",
"deliveryId":"3c8398e1-11a1-4d8d-8b2b-514ad153d1fa",
"hierarchy":{
"parentId":"cc0d019a-2870-4abd-a3b5-3a872ddc720b",
"root":false,
"position":"#y,gO~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
}
},
"title":"Vêtements pour femmes",
"description":"Vêtements pour femmes"
}
}
],
"page":{
"responseCount":8
}
}

Note that if the locale parameter is not included, then content for all locales is returned.

The Hierarchy API supports the same locale filtering rules as the Content Delivery API. See Locale filtering for more details.

Hierarchy API

Hierarchies