Preview template
curl --request POST \
--url https://www.dench.com/api/v1/email/templates/{templateId}/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"firstName": "Ada",
"company": "Lovelace Labs"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {firstName: 'Ada', company: 'Lovelace Labs'}})
};
fetch('https://www.dench.com/api/v1/email/templates/{templateId}/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.dench.com/api/v1/email/templates/{templateId}/preview"
payload = { "data": {
"firstName": "Ada",
"company": "Lovelace Labs"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"subject": "Hi Ada",
"htmlBody": "<p>Hi Ada, saw your work at Lovelace Labs.</p>",
"variableNames": [
"company",
"firstName"
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}email
Preview template
Preview a managed email campaign template.
POST
/
email
/
templates
/
{templateId}
/
preview
Preview template
curl --request POST \
--url https://www.dench.com/api/v1/email/templates/{templateId}/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"firstName": "Ada",
"company": "Lovelace Labs"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {firstName: 'Ada', company: 'Lovelace Labs'}})
};
fetch('https://www.dench.com/api/v1/email/templates/{templateId}/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.dench.com/api/v1/email/templates/{templateId}/preview"
payload = { "data": {
"firstName": "Ada",
"company": "Lovelace Labs"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"subject": "Hi Ada",
"htmlBody": "<p>Hi Ada, saw your work at Lovelace Labs.</p>",
"variableNames": [
"company",
"firstName"
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}Authorizations
DenchApiKeyAgentSession
Workspace-scoped Dench API key from workspace settings. This is the same key used by DENCH_API_KEY in sandboxes.
Path Parameters
Body
application/json
Personalization data for {{variable}} placeholders.
Show child attributes
Show child attributes