List email templates
/v1/email/templatesfor await (const tpl of bird.email.templates.list({ scope: "workspace" })) {
console.log(tpl.slug, tpl.name);
}for template in client.email.templates.list(scope="workspace"):
print(template.slug, template.name)for tpl, err := range client.Email.Templates.List(context.Background(), bird.EmailTemplatesListParams{Scope: "workspace"}) {
if err != nil {
log.Fatal(err)
}
fmt.Println(*tpl.Slug, tpl.Name)
}foreach ($bird->email->templates->list(['scope' => 'workspace']) as $template) {
echo $template->getSlug(), ' ', $template->getName(), "\n";
}bird email templates listcurl -X GET "https://us1.platform.bird.com/v1/email/templates" \
-H "Authorization: Bearer $TOKEN" \
--url-query "limit=25"{
"data": [
{
"id": "emt_01krdgeqcxet5s7t44vh8rt9mg",
"workspace_id": "ws_01krdgeqcxet5s7t44vh8rt9mg",
"slug": "welcome-email",
"name": "Welcome email",
"scope": "workspace",
"status": "active",
"category": "transactional",
"source": "html",
"theme": null,
"draft_version_id": "emv_01krdgeqcxet5s7t44vh8rt9mg",
"live_version_id": "emv_01krdgeqcxet5s7t44vh8rt9mg",
"published_version_id": "emv_01krdgeqcxet5s7t44vh8rt9mg",
"available_languages": [
"en"
],
"default_language": "pt-BR",
"languages": {
"en": {
"status": "live"
},
"de": {
"status": "draft"
}
}
}
],
"next_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE0OjAzOjEwWlwiIiwiaSI6IjAxOTJmM2IxLTRjN2UtN2EyYi05ZDYxLThmM2E1YzJlN2I0MCJ9",
"prev_cursor": null,
"refresh_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE2OjQyOjAxWlwiIiwiaSI6IjAxOTJmM2IxLTllMDQtN2NkMy1iODE3LTJhNmY0ZDFjOGUwOSJ9"
}
Returns a paginated list of email templates, newest first.
The list covers both the workspace's own templates and our built-in system templates. Use
scope to get only one of the two, or leave it out to get both. When you leave it out, the
workspace's own templates come first, newest first, and our built-in templates fill the rest of
the list once the workspace's templates run out.
Filter further by category or authoring format, or search with q, a case-insensitive substring
match against the template's slug, name, and description.
Our built-in templates come in five visual themes. Each theme ships its own set of eight
emails, and the sets overlap only partly. Use theme to see one of them. A template your
workspace authored has no theme, so naming one returns our built-ins alone.
Paramètres de requête
scopestringFilter by who owns the template. Use system for our built-in templates and workspace for the ones your workspace created. Leave it out to get both.
Possible values: system, workspace
categorystringReturn only transactional or marketing templates; omit to return both categories.
Possible values: transactional, marketing
sourcestringReturn only templates authored in this format.
Possible values (may grow over time): html
themestringFilter by the visual theme a built-in template is designed in. Only our built-in templates have a theme, so naming one returns built-ins alone.
Possible values: arcane, barebone, matte, protocol, studio
qstringA case-insensitive substring search across the template's slug, name, and description.
limitintegerMaximum number of items to return per page.
starting_afterstringCursor from the next_cursor field of a previous list response. Returns items immediately after the cursor position in the current sort order.
ending_beforestringCursor from the prev_cursor or refresh_cursor field of a previous list response. Returns items immediately before the cursor position in the current sort order. prev_cursor returns the preceding page. refresh_cursor anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
Contenu de la réponse
next_cursorCursor for the next page. Pass back as starting_after to advance forward. null when no next page exists.
prev_cursorCursor for the previous page. Pass back as ending_before to step backward. null when no previous page exists.
refresh_cursorRefresh anchor, the first row of this response. Pass back as ending_before to fetch what precedes it in the current sort order. On a newest-first sort those are the items that have appeared since; on any other sort they are the items that sort earlier, so refreshing such a list means re-fetching it instead. Non-null whenever data is non-empty; null only on an empty page. Distinct from prev_cursor.
Ressources associées
Poursuivez avec la documentation, les guides et les exemples sur ce sujet.