Add a medical protocol
A name used once, the species and age group it is for (null for every species, any age), and at least one line, at most 30. A line with an age to stop at must repeat. Needs admin on Animals.
POST
https://{organization}.rescueconsole.com
/
api
/
animals
/
medical-protocols
Add a medical protocol
curl --request POST \
--url https://{organization}.rescueconsole.com/api/animals/medical-protocols \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Kittens",
"species": "cat",
"age_band": "baby",
"items": [
{
"record_type": "vaccination",
"name": "FVRCP",
"catalogue_item_id": "mc_fvrcp",
"day_offset": 0,
"recurrence": {
"interval": 3,
"unit": "week"
},
"until_age": {
"value": 16,
"unit": "week"
}
},
{
"record_type": "test",
"name": "FIV / FeLV combo",
"day_offset": 14
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Kittens',
species: 'cat',
age_band: 'baby',
items: [
{
record_type: 'vaccination',
name: 'FVRCP',
catalogue_item_id: 'mc_fvrcp',
day_offset: 0,
recurrence: {interval: 3, unit: 'week'},
until_age: {value: 16, unit: 'week'}
},
{record_type: 'test', name: 'FIV / FeLV combo', day_offset: 14}
]
})
};
fetch('https://{organization}.rescueconsole.com/api/animals/medical-protocols', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/animals/medical-protocols"
payload = {
"name": "Kittens",
"species": "cat",
"age_band": "baby",
"items": [
{
"record_type": "vaccination",
"name": "FVRCP",
"catalogue_item_id": "mc_fvrcp",
"day_offset": 0,
"recurrence": {
"interval": 3,
"unit": "week"
},
"until_age": {
"value": 16,
"unit": "week"
}
},
{
"record_type": "test",
"name": "FIV / FeLV combo",
"day_offset": 14
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"protocol": {
"id": "<string>",
"name": "<string>",
"species": "dog",
"age_band": "<string>",
"is_active": true,
"items": [
{
"record_type": "vaccination",
"name": "<string>",
"id": "<string>",
"catalogue_item_id": "<string>",
"day_offset": 1825,
"recurrence": {
"interval": 260,
"unit": "day"
},
"until_age": {
"value": 260,
"unit": "week"
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"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 a medical protocol
curl --request POST \
--url https://{organization}.rescueconsole.com/api/animals/medical-protocols \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Kittens",
"species": "cat",
"age_band": "baby",
"items": [
{
"record_type": "vaccination",
"name": "FVRCP",
"catalogue_item_id": "mc_fvrcp",
"day_offset": 0,
"recurrence": {
"interval": 3,
"unit": "week"
},
"until_age": {
"value": 16,
"unit": "week"
}
},
{
"record_type": "test",
"name": "FIV / FeLV combo",
"day_offset": 14
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Kittens',
species: 'cat',
age_band: 'baby',
items: [
{
record_type: 'vaccination',
name: 'FVRCP',
catalogue_item_id: 'mc_fvrcp',
day_offset: 0,
recurrence: {interval: 3, unit: 'week'},
until_age: {value: 16, unit: 'week'}
},
{record_type: 'test', name: 'FIV / FeLV combo', day_offset: 14}
]
})
};
fetch('https://{organization}.rescueconsole.com/api/animals/medical-protocols', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/animals/medical-protocols"
payload = {
"name": "Kittens",
"species": "cat",
"age_band": "baby",
"items": [
{
"record_type": "vaccination",
"name": "FVRCP",
"catalogue_item_id": "mc_fvrcp",
"day_offset": 0,
"recurrence": {
"interval": 3,
"unit": "week"
},
"until_age": {
"value": 16,
"unit": "week"
}
},
{
"record_type": "test",
"name": "FIV / FeLV combo",
"day_offset": 14
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"protocol": {
"id": "<string>",
"name": "<string>",
"species": "dog",
"age_band": "<string>",
"is_active": true,
"items": [
{
"record_type": "vaccination",
"name": "<string>",
"id": "<string>",
"catalogue_item_id": "<string>",
"day_offset": 1825,
"recurrence": {
"interval": 260,
"unit": "day"
},
"until_age": {
"value": 260,
"unit": "week"
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"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)"
}
