Skip to content

Preview a stream

POST
/content/management/v1/streams/{id}/preview
curl --request POST \
--url https://api.ebitex.io/content/management/v1/streams/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "deliveryEnvironmentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "locale": "example", "limit": 1, "filters": "example" }'

Runs the stream’s saved definition against published content and returns its first page, as delivery would. It changes nothing, and it previews the definition as saved, so save an edit before previewing it.

The body takes deliveryEnvironmentId (optional when the key’s environment publishes to exactly one), locale, limit (1 to 100, default 20) and filters, an object of declared filter keys to arrays of values.

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

id
required
string format: uuid
Media typeapplication/json
object
deliveryEnvironmentId
required
null | string format: uuid
locale
required
null | string
limit
required
null | integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
filters
required
null | object
Examplegenerated
{
"deliveryEnvironmentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"locale": "example",
"limit": 1,
"filters": "example"
}

One page shaped as delivery’s queryStream returns it.

delivery_target_not_mapped: deliveryEnvironmentId is not one the key’s environment publishes to. ambiguous_delivery_target: several are mapped; name one. no_delivery_target_mapped: the key’s environment publishes nowhere. validation_failed: a filter the stream does not declare, a value over the length limit, or more than one full-text value. invalid_filter_value: a date value is not YYYY-MM. unknown_category: no category has this path or id. category_not_in_group: the category belongs to a different group from the one the filter is scoped to.

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 stream has this id in the key’s environment.

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