Skip to content

Resolve a draft preview

POST
/content/management/v1/preview/resolve
curl --request POST \
--url https://api.ebitex.io/content/management/v1/preview/resolve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "kind": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "document": {}, "locale": "example", "ctx": {}, "resolveDepth": 0, "annotate": false, "overrides": "example", "deliveryEnvironmentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "owner": { "kind": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }, "path": [ "example" ], "wrap": [ { "template": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "templateVersion": 1, "settings": {}, "field": "example", "contract": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "contractVersion": 1 } ], "subject": {} }'

Resolves a component or page as delivery would, from its current saved draft rather than its published version. Changes nothing.

Send kind (component or node) and id. To preview unsaved edits, send them as document: a component’s whole document, or { "payload": … } for a page. ctx is the visitor context used for personalization — omit it, or send {}, when there is none. locale picks localized values, and a resolveDepth above 0 expands references from their drafts as well. Links are composed as a delivery environment would compose them; name it with deliveryEnvironmentId when the key’s environment publishes to more than one.

A third kind, presentation, previews one presentation inside another entity’s document, shown as a page would show it. Send owner ({ "kind": "component" or "node", "id": … }, the entity whose document holds it), path (where it sits in that document, an array of field names and positions; or send subject, a presentation envelope you built, instead) and, optionally, document (the owner’s unsaved draft). wrap is the context, outermost first, at most 3 deep: each link names a template and templateVersion, its settings, and the field of its content Contract that holds the next link or the presentation (give contract and contractVersion when the Template supports any Contract). With annotate, every annotation inside the presentation names the owner and the owner’s own path, and a context link is marked synthetic: true with no path.

Key: a management key with content.management.read.

Media typeapplication/json
object
kind
required
string
id
required
string format: uuid
document
required
One of:
null
locale
required
null | string
ctx
required
One of:
null
resolveDepth
integer | string format: int32
0 /^-?(?:0|[1-9]\d*)$/
annotate
boolean
overrides
null | object
deliveryEnvironmentId
null | string format: uuid
owner
One of:
null
path
One of:
null
wrap
Array<object> | null
object
template
required
string format: uuid
templateVersion
required
integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
settings
required
One of:
null
field
required
string
contract
null | string format: uuid
contractVersion
null | integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
subject
One of:
null

The resolved document.

validation_failed: kind is not component, node or presentation; for presentation, owner is not a component or node, path holds no presentation in the owner’s document, a wrap[i].template does not accept the presentation inside it, a wrap[i].contract is missing or not one the Template supports, or wrap is deeper than 3. invalid_context: ctx is not a valid context bag. delivery_target_not_mapped: deliveryEnvironmentId is not one the key’s environment publishes to. ambiguous_delivery_target: several are mapped; name one.

missing_api_key or invalid_api_key: no key was sent, or it is unknown, revoked or expired.

payment_required: the organization’s subscription needs attention.

access_denied: a branch access rule stops the key’s role viewing this component or page.

scope_denied: the key lacks this route’s scope. tier_required: the Content Management API needs the Pro plan or above. ip_denied: the caller’s address is outside the key’s allowed ranges. app_not_available: Content is not enabled for the organization.

No component or page has this id.

Rate limit or quota exceeded; Retry-After says how long to wait. too_many_failed_authentications: too many bad keys from this address.