Skip to main content

Multiple delivery keys example

This schema snippet shows how you can define multiple delivery keys in your content form. This allows you to add delivery keys that can be mapped to locales and used to manage URLs for localized versions of website pages. These URLs could be used to build the hreflang element in the shoes website page to improve the website SEO for different languages and regions.

You can find out more about multiple delivery keys in the Delivery key developer guide.

Pre-requisites
Link copied!

You must have our next generation Delivery API enabled on your hub to use delivery keys.

How to use
Link copied!

Add one or more delivery keys to list in the meta field. In this example we have set a minimum of 4 delivery keys, but this can be modified to meet your requirements.

The delivery keys array is not a localized field, so you will need to use a naming convention to identify the locale a delivery key represents. Adding the locale at the start of the key, for example fr/hommes/chaussures is one way of mapping the delivery key to its locale.

The example also includes a localized string field that is used to add a title to each delivery key.

Multiple delivery keys example
Link copied!

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema-examples.com/multiple-delivery-keys",
"title": "Multiple delivery keys",
"description": "How to add multiple delivery keys to a content item",
"$comment": "Docs: https://amplience.com/developers/docs/schema-reference/schema-examples/core-concepts/multiple-delivery-keys/",
"allOf": [
{
"$ref": "http://bigcontent.io/cms/schema/v1/core#/definitions/content"
}
],
"type": "object",
"properties": {
"_meta": {
"type": "object",
"properties": {
"deliveryKeys": {
"type": "object",
"properties": {
"values": {
"type": "array",
"items": {
"type": "object",
"minlength": 4,
"properties": {
"value": {
"type": "string"
}
}
}
}
}
}
}
},
"Title": {
"title": "title",
"description": "description",
"allOf": [
{
"$ref": "http://bigcontent.io/cms/schema/v1/localization#/definitions/localized-string"
}
]
}
},
"propertyOrder": []
}

Content form preview
Link copied!

An example of creating a content item using a content type registered from the multiple delivery keys schema is shown in the image below.

Content created from the multiple delivery keys content type