Skip to main content
POST
/
v3
/
targets
/
preview
Preview a Target Template
curl --request POST \
  --url https://api.{tenant}.getomneo.com/api/v3/targets/preview \
  --header 'Content-Type: application/json' \
  --data '
{
  "resource_id": "<string>",
  "template": "<string>",
  "target_id": 123
}
'
{
  "data": {
    "result": {},
    "context": {}
  }
}

Body

application/json

Provide either an inline template or a target_id. One of the two is required; if both are sent, the inline template takes precedence.

resource
enum<string>
required

The resource type to render the template against.

Available options:
profile,
transaction,
transaction_item,
order,
order_item,
reward
resource_id
string
required

The ID of the resource record to render against.

template
string
required

An inline Twig template to render. Required when target_id is omitted.

target_id
integer

The ID of an existing Target whose template to render. Required when template is omitted.

Response

The rendered, JSON-decoded template and the context it was rendered against.

data
object
required