Skip to main content

Content Delivery API- depth enhancement

Release date: 2nd March 2022

In this release we've made some enhancements to our next generation Content Delivery API, Content Delivery 2. You can now specify a numeric depth when retrieving nested content to provide flexibility and improve performance.

Specifying the depth when retrieving content
Link copied!

In the Content Delivery 2 API, the depth parameter allows you to control how to retrieve nested content- content that links to other content items. This might be a carousel that links to carousel slides, or a more complex content item that includes several levels of content links.

Previously you could only specify depth=root or depth=all to return the root item only, or the root item and all of its dependents, but now you can set depth to an integer between 0 and 22. Specifying 0 is the same as root while 22 is the current maximum depth of a content graph.

The example shown below is a carousel. The carousel links to up to 6 carousel slides, each of which has a content link to an image content item. The depth of the dependency tree for the carousel is 2.

The carousel links to carousel slides and image content items.

To retrieve the carousel, the carousel slides and just the content item ids of the image items, we can specify a depth of 1:

https://ampproduct-doc.cdn.content.amplience.net/content/id/bd89c2ed-0ed5-4304-8c89-c0710af500e2?depth=1&format=inlined

If we specify depth=all, then the entire dependency tree is returned, including the carousel, carousel slides and the complete image content items.

The carousel is a simplified example and this feature will be even more useful when retrieving content with larger dependency trees.

For more information see the Content Delivery 2 API overview overview page.

Content Delivery 2 API overview