Content Delivery v2
Base URL: https://{hubName}.cdn.content.amplience.net
OpenAPI Spec: content-delivery.json. Import into Postman, Insomnia, or any OpenAPI-compatible tool, or use directly with AI coding tools for accurate completions.
EndpointsLink copied!
| Method | Endpoint | Summary |
|---|---|---|
GET | /content/id/{id} | Get a content item by id |
GET | /content/key/{key} | Get a content item by delivery key |
POST | /content/fetch | Get multiple content items by id and/or key |
POST | /content/filter | Filter content items |
GET | /health | Health check |
IntroductionLink copied!
The Content Delivery v2 API is used to retrieve content items and slots from Dynamic Content in JSON format. The API is optimized for speed, and for flexibility, allowing you to retrieve content by id as well as key, and choose the format of the response. These features make it easier for you to deliver your content to websites, apps, ecommerce systems, voice driven devices and many other types of applications.
The main features of Content Delivery v2 are:
-
Retrieve content by id or delivery key. Keys are arbitrary strings of up to 150 characters that can be associated with slots and content items. A delivery key can be used instead of the content id to retrieve content.
-
Specify the format of the response. You can retrieve content in a bandwidth optimised linked data format or inlined in a content tree. For linked content, such as a carousel or grid that contains links to other content, you have three options for the depth of content to be retrieved. You can choose to retrieve the root item, all linked items or you can set the depth to between 0 and 22, to retrieve a partial dependency tree.
-
List, sort and filter content. You can list content by content type schema, specify a sort order and filter by one or more user defined properties and values.
You can find more information about Content Delivery v2 and examples in the Content Delivery v2 overview.
Delivery keysLink copied!
A delivery key can be a simple string or a path such as "home-page/feature-banner". This makes it simpler to write your integration code and allows users more control over where items of content are delivered. You can add a delivery key to a content item or slot in the Dynamic Content app or using the Dynamic Content Management API.
Note that a delivery key may not start or end with "/" and must be between 1 and 150 characters. Delivery keys can contain the following alphanumeric characters: a to z, A to Z and 0 to 9. You can also include "-" and "_" and "/" as long as it is not included at the start or end of the key.
NotesLink copied!
- Content Delivery v2 must be provisioned on your hub before you can use the API.
- Content published from hubs that have Content Delivery v2 enabled will be accessible from both the Legacy Content Delivery API and the Content Delivery v2 API.
- The current version of the Dynamic Content Salesforce Commerce Cloud integration does not use Content Delivery v2 and so cannot make use of features such as delivery keys.
Get a content item by idLink copied!
GET /content/id/{id}
Retrieves a Content Item by its id
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Host | header | string | ✓ | The hostname containing the hub name Example: anya-finn.cdn.content.amplience.net |
id | path | string | ✓ | content item UUID |
depth | query | string | One of: string root (default) retrieves the root content item onlyall retrieves the full dependency treeinteger The depth of the dependency tree to retrieve. A value between 0 and 22, with 0 being the root. | |
format | query | string | One of:linked (default) delivered with a lookup array for bandwidth optimisation.inlined delivered with content-link replacement (will not conform to the content type). | |
locale | query | string | A comma separated list of ISO supported language and region codes |
Responses
| Status | Description |
|---|---|
| 200 | Gives the Content Item body, and the bodies of any linked content items if depth is all |
| 400 | Bad request |
| 404 | Not found |
| 500 | Internal error |
| 524 | Request timeout |
Response example (200): Returned content. No parameters.
Response example (200): Returned content. depth=all
Response example (200): Returned content. depth=all, format=inlined
Response example (200): Returned content. depth=1, format=inlined
Response example (404): Root content item could not be found
Response example (404): One or more linked content items could not be found
Get a content item by delivery keyLink copied!
GET /content/key/{key}
Retrieves a Content Item by its delivery key
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Host | header | string | ✓ | The hostname containing the hub name Example: anya-finn.cdn.content.amplience.net |
depth | query | string | One of: string root (default) retrieves the root content item onlyall retrieves the full dependency treeinteger The depth of the dependency tree to retrieve. A value between 0 and 22, with 0 being the root. | |
format | query | string | One of:linked (default) delivered with a lookup array for bandwidth optimisation.inlined delivered with content-link replacement (will not conform to the content type). | |
locale | query | string | A comma separated list of ISO supported language and region codes |
Responses
| Status | Description |
|---|---|
| 200 | Gives the Content Item body, and the bodies of any linked content items if depth is all |
| 400 | Bad request |
| 404 | Not found |
| 500 | Internal error |
| 524 | Request timeout |
Response example (200): Returned content. No parameters.
Response example (200): Returned content. depth=all
Response example (200): Returned content. depth=all, format=inlined
Response example (200): Returned content. depth=1, format=inlined
Response example (404): Root content item could not be found
Response example (404): One or more linked content items could not be found
Get multiple content items by id and/or keyLink copied!
POST /content/fetch
Retrieves multiple content item by their id or delivery key
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Host | header | string | ✓ | The hostname containing the hub name Example: anya-finn.cdn.content.amplience.net |
Request Body
Request body for retrieving multiple content items by id and/or delivery key
| Field | Type | Required | Description |
|---|---|---|---|
parameters | object (Parameters) | ||
requests | array (ItemRequestById or ItemRequestByKey) | ✓ |
parameters fields: Parameters
| Field | Type | Required | Description |
|---|---|---|---|
depth | string | One of: string root (default) retrieves the root content item onlyall retrieves the full dependency treeinteger The depth of the dependency tree to retrieve. A value between 0 and 22, with 0 being the root. | |
format | string | One of:linked (default) delivered with a lookup array for bandwidth optimisation.inlined delivered with content-link replacement (will not conform to the content type). | |
locale | string | A comma separated list of ISO supported language and region codes |
requests item fields: ItemRequestById
| Field | Type | Required | Description |
|---|---|---|---|
id | string | ✓ | Content Item UUID |
overrides | object (Parameters) |
overrides fields: Parameters
| Field | Type | Required | Description |
|---|---|---|---|
depth | string | One of: string root (default) retrieves the root content item onlyall retrieves the full dependency treeinteger The depth of the dependency tree to retrieve. A value between 0 and 22, with 0 being the root. | |
format | string | One of:linked (default) delivered with a lookup array for bandwidth optimisation.inlined delivered with content-link replacement (will not conform to the content type). | |
locale | string | A comma separated list of ISO supported language and region codes |
requests item fields: ItemRequestByKey
| Field | Type | Required | Description |
|---|---|---|---|
key | string | ✓ | Content Item delivery key |
overrides | object (Parameters) |
overrides fields: Parameters
| Field | Type | Required | Description |
|---|---|---|---|
depth | string | One of: string root (default) retrieves the root content item onlyall retrieves the full dependency treeinteger The depth of the dependency tree to retrieve. A value between 0 and 22, with 0 being the root. | |
format | string | One of:linked (default) delivered with a lookup array for bandwidth optimisation.inlined delivered with content-link replacement (will not conform to the content type). | |
locale | string | A comma separated list of ISO supported language and region codes |
Request example: Minimal multi-item request showing requests by id and delivery key
Request example: Full multi-item request showing requests by id and delivery key, and use of parameters and overrides.
Request example: Multi-item request showing requests by id and delivery key with variable depth.
Responses
| Status | Description |
|---|---|
| 200 | Contains the requested content item bodies and associated linked content items, in the order that they were requested. |
| 400 | Bad request |
| 500 | Internal error |
Response example (200): Multiple returned content items showing linked content
Response example (200): Multiple returned content items showing inlined content
Response example (200): Multiple returned content items showing a depth of 1 with linked content
Response example (200): Multiple items response showing an error example
Filter content itemsLink copied!
POST /content/filter
List, sort and filter content items. Items are filtered by paths and values.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Host | header | string | ✓ | The hostname containing the hub name Example: anya-finn.cdn.content.amplience.net |
Request Body
Request body for querying for content
| Field | Type | Required | Description |
|---|---|---|---|
filterBy | array (FilterObject) | ✓ | A maximum of 6 paths may be specified |
sort | object (SortingPair) | ||
page | object | ||
parameters | object (Parameters) |
filterBy item fields: FilterObject
| Field | Type | Required | Description |
|---|---|---|---|
path | string | The property to filter, must be in JSON pointer format | |
value | string | The value to match against |
sort fields: SortingPair
| Field | Type | Required | Description |
|---|---|---|---|
key | string | The sort key defined in the schema | |
order | string | ASC or DESC |
page fields
| Field | Type | Required | Description |
|---|---|---|---|
size | number | The number of items per page (maximum/default number of items per page is 12) | |
cursor | string | Used to retrieve the next request if returning multiple pages |
parameters fields: Parameters
| Field | Type | Required | Description |
|---|---|---|---|
depth | string | One of: string root (default) retrieves the root content item onlyall retrieves the full dependency treeinteger The depth of the dependency tree to retrieve. A value between 0 and 22, with 0 being the root. | |
format | string | One of:linked (default) delivered with a lookup array for bandwidth optimisation.inlined delivered with content-link replacement (will not conform to the content type). | |
locale | string | A comma separated list of ISO supported language and region codes |
Request example: Minimal filterBy request
Request example: Request including a sort
Request example: Multiple filterBy request with two filters
Request example: Request with page size
Request example: Full filterBy request including sortBy, parameters, filterBy and page blocks
Request example: Full request with max variable depth
Responses
| Status | Description |
|---|---|
| 200 | Contains the requested content |
| 400 | Bad request |
| 500 | Internal error |
| 524 | Request timeout |
Response example (200): Response with multiple content items, with a page count and next cursor
Response example (200): Response example for no items found
Response example (200): Response with a depth of 1, multiple content items and a page count
Response example (400): InvalidPropertyValue
Health checkLink copied!
GET /health
Provide information about the health of the service
Responses
| Status | Description |
|---|---|
| 200 | Api is operational |