curl --request POST \
--url https://{organization}.rescueconsole.com/api/communications/templates/{id}/fill \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"person_id": "6d1f3a52-0b7e-4c1a-9d2f-5e8b7c4a1f20",
"related_entity_type": "animal",
"related_entity_id": "a3c9e1f4-2d6b-4f8a-b1c7-9e0d5f3a2b61"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
person_id: '6d1f3a52-0b7e-4c1a-9d2f-5e8b7c4a1f20',
related_entity_type: 'animal',
related_entity_id: 'a3c9e1f4-2d6b-4f8a-b1c7-9e0d5f3a2b61'
})
};
fetch('https://{organization}.rescueconsole.com/api/communications/templates/{id}/fill', 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/{id}/fill"
payload = {
"person_id": "6d1f3a52-0b7e-4c1a-9d2f-5e8b7c4a1f20",
"related_entity_type": "animal",
"related_entity_id": "a3c9e1f4-2d6b-4f8a-b1c7-9e0d5f3a2b61"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"template_id": "<string>",
"template_key": "<string>",
"template_version": 123,
"subject": "<string>",
"body_blocks": [
{
"type": "p",
"runs": [
{
"text": "<string>",
"bold": true,
"italic": true,
"underline": true,
"strike": true,
"href": "<string>"
}
]
}
],
"unfilled": [
"<string>"
],
"person_id": "<string>",
"person_ids": [
"<string>"
],
"related_entity_type": "<string>",
"related_entity_id": "<string>",
"animal_ids": [
"<string>"
]
}{
"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)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}Fill a template
Fills an active template from your records and gives the message back to read and change before it is sent. It sends nothing and changes nothing. A merge field nothing fills is not an error here: it comes back in unfilled, still written in the message. 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/{id}/fill \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"person_id": "6d1f3a52-0b7e-4c1a-9d2f-5e8b7c4a1f20",
"related_entity_type": "animal",
"related_entity_id": "a3c9e1f4-2d6b-4f8a-b1c7-9e0d5f3a2b61"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
person_id: '6d1f3a52-0b7e-4c1a-9d2f-5e8b7c4a1f20',
related_entity_type: 'animal',
related_entity_id: 'a3c9e1f4-2d6b-4f8a-b1c7-9e0d5f3a2b61'
})
};
fetch('https://{organization}.rescueconsole.com/api/communications/templates/{id}/fill', 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/{id}/fill"
payload = {
"person_id": "6d1f3a52-0b7e-4c1a-9d2f-5e8b7c4a1f20",
"related_entity_type": "animal",
"related_entity_id": "a3c9e1f4-2d6b-4f8a-b1c7-9e0d5f3a2b61"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"template_id": "<string>",
"template_key": "<string>",
"template_version": 123,
"subject": "<string>",
"body_blocks": [
{
"type": "p",
"runs": [
{
"text": "<string>",
"bold": true,
"italic": true,
"underline": true,
"strike": true,
"href": "<string>"
}
]
}
],
"unfilled": [
"<string>"
],
"person_id": "<string>",
"person_ids": [
"<string>"
],
"related_entity_type": "<string>",
"related_entity_id": "<string>",
"animal_ids": [
"<string>"
]
}{
"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)"
}{
"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_.
Path Parameters
The template's ID (not its key).
Body
The person the message is to.
Several people it is to, 20 at most. Names fill as a list, such as Jordan and Sam.
The animals it is about, 20 at most.
The record it is about. Send it with related_entity_id, or neither. An animal fills the animal fields; an adoption_application fills the applicant and the animals applied for; a form_submission fills the person it became; a person fills that person.
A conversation to take the person and the record from, when you name neither. Only links someone confirmed are used.
Values of your own, by merge field name. They win over the records.
Response
The filled message.
The version whose wording this is.
The subject, filled.
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
The merge fields nothing filled, in the order they first appear. They are still in the text, as written; sending the message with one left in is refused.
The person it was filled for.