Add an assessment
A question’s key and an answer’s value are made from their labels when not sent. 400 without a name, without a question, or for a question with fewer than two answers; 409 when you have an assessment of that name. Needs admin on Animals.
POST
https://{organization}.rescueconsole.com
/
api
/
animals
/
assessment-templates
Add an assessment
curl --request POST \
--url https://{organization}.rescueconsole.com/api/animals/assessment-templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Compatibility",
"species": [
"dog",
"cat"
],
"questions": [
{
"label": "With dogs",
"fills": "good_with_dogs",
"options": [
{
"label": "Yes",
"fill": "yes"
},
{
"label": "No",
"fill": "no"
},
{
"label": "Unknown"
}
]
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Compatibility',
species: ['dog', 'cat'],
questions: [
{
label: 'With dogs',
fills: 'good_with_dogs',
options: [{label: 'Yes', fill: 'yes'}, {label: 'No', fill: 'no'}, {label: 'Unknown'}]
}
]
})
};
fetch('https://{organization}.rescueconsole.com/api/animals/assessment-templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/animals/assessment-templates"
payload = {
"name": "Compatibility",
"species": ["dog", "cat"],
"questions": [
{
"label": "With dogs",
"fills": "good_with_dogs",
"options": [{
"label": "Yes",
"fill": "yes"
}, {
"label": "No",
"fill": "no"
}, { "label": "Unknown" }]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"template": {
"id": "<string>",
"name": "<string>",
"questions": [
{
"label": "<string>",
"options": [
{
"value": "<string>",
"label": "<string>",
"score": 123,
"fill": "yes",
"min_age": 9
}
],
"key": "<string>",
"fills": "good_with_dogs"
}
],
"is_active": true,
"species": [
"<string>"
],
"description": "<string>",
"starter_key": "<string>",
"sort_order": 123
}
}{
"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
Body
application/json
⌘I
Add an assessment
curl --request POST \
--url https://{organization}.rescueconsole.com/api/animals/assessment-templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Compatibility",
"species": [
"dog",
"cat"
],
"questions": [
{
"label": "With dogs",
"fills": "good_with_dogs",
"options": [
{
"label": "Yes",
"fill": "yes"
},
{
"label": "No",
"fill": "no"
},
{
"label": "Unknown"
}
]
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Compatibility',
species: ['dog', 'cat'],
questions: [
{
label: 'With dogs',
fills: 'good_with_dogs',
options: [{label: 'Yes', fill: 'yes'}, {label: 'No', fill: 'no'}, {label: 'Unknown'}]
}
]
})
};
fetch('https://{organization}.rescueconsole.com/api/animals/assessment-templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/animals/assessment-templates"
payload = {
"name": "Compatibility",
"species": ["dog", "cat"],
"questions": [
{
"label": "With dogs",
"fills": "good_with_dogs",
"options": [{
"label": "Yes",
"fill": "yes"
}, {
"label": "No",
"fill": "no"
}, { "label": "Unknown" }]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"template": {
"id": "<string>",
"name": "<string>",
"questions": [
{
"label": "<string>",
"options": [
{
"value": "<string>",
"label": "<string>",
"score": 123,
"fill": "yes",
"min_age": 9
}
],
"key": "<string>",
"fills": "good_with_dogs"
}
],
"is_active": true,
"species": [
"<string>"
],
"description": "<string>",
"starter_key": "<string>",
"sort_order": 123
}
}{
"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)"
}
