Preview an adapter
const url = 'https://api.ebitex.io/content/management/v1/adapters/preview';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"adapterId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","outputContractId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","rules":["example"],"provider":"example","key":"example","contextualValues":{},"context":"example","locale":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ebitex.io/content/management/v1/adapters/preview \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "adapterId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "outputContractId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "rules": [ "example" ], "provider": "example", "key": "example", "contextualValues": {}, "context": "example", "locale": "example" }'Runs a mapping over one component and returns what it produces, without saving anything. Name the mapping either as a saved adapter (adapterId) or inline (outputContractId plus rules), and the component as provider and key (the component’s id).
The input is the component’s current saved document, not its published version. contextualValues overrides fields of that document for this preview, and locale and context resolve localized and personalized values as delivery would. References inside the input are not expanded. Problems that would not stop delivery, such as a lookup that finds nothing, come back as warnings.
Key: a management key with content.management.authoring.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{ "adapterId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "outputContractId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "rules": [ "example" ], "provider": "example", "key": "example", "contextualValues": {}, "context": "example", "locale": "example"}Responses
Section titled “ Responses ”{ "content": { … }, "warnings": [ … ] }: the output document and any warnings.
validation_failed: neither adapterId nor both outputContractId and rules were sent.
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.
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 adapter has adapterId, or no component has key, in the key’s environment.
adapter_invalid with invalid_rules: the inline rules are not well-formed.
Rate limit or quota exceeded; Retry-After says how long to wait. too_many_failed_authentications: too many bad keys from this address.