Get a Hierarchy's Children
GEThttps://euwest.api.elasticpath.com/catalogs/:catalog_id/releases/:release_id/hierarchies/:hierarchy_id/children
Returns the parent nodes for the specified hierarchy from a published catalog.
Currently, published catalogs are limited to the current release and two releases prior to the current release.
In the breadcrumbs
metadata, you can identify the parent nodes that a node is associated with. This is useful if you want to improve how your shoppers search your store, for example. See Product and Node Associations in Breadcrumb Metadata.
Filtering
This endpoint supports filtering. For general syntax, see Filtering.
Operator | Description | Supported Attributes | Example |
---|---|---|---|
Eq | Checks if the values of two operands are equal. If they are, the condition is true. | name , slug | filter=eq(name,some-name) |
In | Checks if the values are included in the specified string. If they are, the condition is true. | id | filter=in(id,some-id) |
Building breadcrumbs in a storefront
In a catalog, you can use the nodes directly attached to a product to build breadcrumbs in your storefront. This eliminates the need for additional queries to fetch hierarchy or parent node details. Each node contains all the necessary information in breadcrumbs
metadata, such as its own details and the details of its parent hierarchy/node(s), to construct the complete breadcrumb path without requiring additional queries.
An example is shown below:
filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)
- Specify the node IDs directly attached to the product in the filter expression.
- You can include as many node IDs as required.
- It does not matter what order you specify the node IDs. The nodes are returned in the order they were last updated.
Request
Responses
- 200
- default
The child nodes of a catalog hierarchy.
The unexpected error.
Authorization: Authorization
name: Authorizationtype: httpin: headerscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://euwest.api.elasticpath.com/catalogs/:catalog_id/releases/:release_id/hierarchies/:hierarchy_id/children");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <Authorization>");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());