Sign inGet Started

Get published email template parameters

GET
/v1/email/templates/{template_ref}/parameters
const discovery = await bird.email.templates.parameters(
  "emt_01krdgeqcxet5s7t44vh8rt9mg",
);
console.log(discovery.parameters, discovery.variables);
Risposta200
{
  "template_id": "emt_01krdgeqcxet5s7t44vh8rt9mg",
  "observed_version_id": "emv_01krdgeqcxet5s7t44vh8rt9mg",
  "requested_language": "pt-BR",
  "effective_language": "pt-BR",
  "parameters": [
    {
      "name": "offer",
      "type": "text",
      "value_domain": "scalar",
      "use_constraints": [
        {
          "kind": "value",
          "site": "html"
        }
      ]
    }
  ],
  "variables": [
    {
      "path": "bird.contact.first_name",
      "source": "contact",
      "use_constraints": [
        {
          "kind": "value",
          "site": "html"
        }
      ]
    }
  ]
}

Get the parameters and variables used by the template's published content in one language. The result describes the template and holds no saved values. Parameters are the names a broadcast supplies in template.parameters, and variables are the bird. references Bird fills in. The result identifies list values, which broadcast parameters cannot supply. It also includes a fingerprint that identifies the published content without exposing contact values. You cannot select an older template version. Requires email_marketing read permission in addition to email_management read. Parameter sites cover template subject, HTML and text; envelope overrides are checked by broadcast validation.

Parametri

template_refstring

Workspace template ID, workspace template slug, or built-in template slug.

Parametri di query

languagestring

Language of the template's published content. Omission uses the template's default language.

Payload di risposta

template_id
string
obbligatorio

The template that was read.

observed_version_id
string
obbligatorio

The published template version that was read.

requested_language
string

The language requested with language. Absent when none was requested and the published version's default language is used.

effective_language
string
obbligatorio

The language whose content was read.

requirements_fingerprint
string
obbligatorio

An opaque value that changes when this content or the parameters and variables it uses change, including for built-in templates whose version ID stays the same. Compare it with an earlier value to tell whether they are still the same. Do not parse it.

parameters
array of object
obbligatorio

The parameters the broadcast supplies, sorted by name.

Mostra attributi secondari
variables
array of object
obbligatorio

The bird. variables Bird fills in, sorted by path.

Mostra attributi secondari

Continua con la documentazione, le guide e gli esempi per questo argomento.