curl --request POST \
--url https://{organization}.rescueconsole.com/api/communications/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "adoption_meet_greet",
"name": "Meet and greet invitation",
"subject_template": "Come and meet {{animal_name}}",
"body_template": "Hello {{first_name}},\n\nThank you for applying to adopt {{animal_name}}. We would love you to visit us this Saturday at 10am.\n\n{{org_name}}",
"status": "active"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
key: 'adoption_meet_greet',
name: 'Meet and greet invitation',
subject_template: 'Come and meet {{animal_name}}',
body_template: 'Hello {{first_name}},\n\nThank you for applying to adopt {{animal_name}}. We would love you to visit us this Saturday at 10am.\n\n{{org_name}}',
status: 'active'
})
};
fetch('https://{organization}.rescueconsole.com/api/communications/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/communications/templates"
payload = {
"key": "adoption_meet_greet",
"name": "Meet and greet invitation",
"subject_template": "Come and meet {{animal_name}}",
"body_template": "Hello {{first_name}},
Thank you for applying to adopt {{animal_name}}. We would love you to visit us this Saturday at 10am.
{{org_name}}",
"status": "active"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"key": "<string>",
"channel": "email",
"subject_template": "<string>",
"body_template": "<string>",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"tenant_id": "<string>",
"name": "<string>",
"body_template_blocks": [
{
"type": "p",
"runs": [
{
"text": "<string>",
"bold": true,
"italic": true,
"underline": true,
"strike": true,
"href": "<string>"
}
]
}
],
"variables": [
"<unknown>"
],
"metadata": {}
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}Create a template
Creates a template and records its wording as version 1. It is active unless you say otherwise, and an active template can be sent at once by anything that names its key. Merge fields are written {{first_name}}. Filled from your records: first_name, last_name, full_name, email, phone (the person), animal_name, animal_species, animal_breed, animal_sex, animal_id (the animal’s Pet ID) and org_name. Anything else, such as org_email, org_phone or org_website, is filled only from the variables you send. Needs write on Communications.
curl --request POST \
--url https://{organization}.rescueconsole.com/api/communications/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "adoption_meet_greet",
"name": "Meet and greet invitation",
"subject_template": "Come and meet {{animal_name}}",
"body_template": "Hello {{first_name}},\n\nThank you for applying to adopt {{animal_name}}. We would love you to visit us this Saturday at 10am.\n\n{{org_name}}",
"status": "active"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
key: 'adoption_meet_greet',
name: 'Meet and greet invitation',
subject_template: 'Come and meet {{animal_name}}',
body_template: 'Hello {{first_name}},\n\nThank you for applying to adopt {{animal_name}}. We would love you to visit us this Saturday at 10am.\n\n{{org_name}}',
status: 'active'
})
};
fetch('https://{organization}.rescueconsole.com/api/communications/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/communications/templates"
payload = {
"key": "adoption_meet_greet",
"name": "Meet and greet invitation",
"subject_template": "Come and meet {{animal_name}}",
"body_template": "Hello {{first_name}},
Thank you for applying to adopt {{animal_name}}. We would love you to visit us this Saturday at 10am.
{{org_name}}",
"status": "active"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"key": "<string>",
"channel": "email",
"subject_template": "<string>",
"body_template": "<string>",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"tenant_id": "<string>",
"name": "<string>",
"body_template_blocks": [
{
"type": "p",
"runs": [
{
"text": "<string>",
"bold": true,
"italic": true,
"underline": true,
"strike": true,
"href": "<string>"
}
]
}
],
"variables": [
"<unknown>"
],
"metadata": {}
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}Authorizations
An API key from Settings, API keys. It starts with rc_live_.
Body
Send the body as body_template (plain text) or as body_template_blocks (a document). When you send a document, the plain text is made from it and any body_template you sent beside it is ignored. One of the two is required.
What a send names this template by. It must be unused in your organization and cannot be changed later.
11The name people read. Trimmed, and cut to 120 characters.
A message written as a document: at most 200 blocks.
One block of a document. An unknown type is refused.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
Show child attributes
Show child attributes
A list kept with the template, such as the merge fields it uses.
active, draft, archived Response
The template, as it was created.
What a send names the template by. It cannot be changed.
Always email.
email The subject, with any {{merge_fields}}.
The body as plain text, with any {{merge_fields}}. When the template is written as a document, this is the document's text.
Only an active template can be sent or filled.
active, draft, archived Your organization's ID.
The name people read. Null means the key stands in for it.
The body as a document, or null for a template written as plain text.
One block of a document. An unknown type is refused.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
Show child attributes
Show child attributes
A list kept with the template, as you last sent it.
Anything else you keep with the template.