Change a medical protocol
Any of the fields of a new one. items, when sent, replaces every line. Animals it was already applied to keep their records. Needs admin on Animals.
PATCH
https://{organization}.rescueconsole.com
/
api
/
animals
/
medical-protocols
/
{id}
Change a medical protocol
curl --request PATCH \
--url https://{organization}.rescueconsole.com/api/animals/medical-protocols/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"age_band": "<string>",
"is_active": true,
"items": [
{
"name": "<string>",
"catalogue_item_id": "<string>",
"day_offset": 1825,
"recurrence": {
"interval": 260
},
"until_age": {
"value": 260
}
}
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
age_band: '<string>',
is_active: true,
items: [
{
name: '<string>',
catalogue_item_id: '<string>',
day_offset: 1825,
recurrence: {interval: 260},
until_age: {value: 260}
}
]
})
};
fetch('https://{organization}.rescueconsole.com/api/animals/medical-protocols/{id}', 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/{id}"
payload = {
"name": "<string>",
"age_band": "<string>",
"is_active": True,
"items": [
{
"name": "<string>",
"catalogue_item_id": "<string>",
"day_offset": 1825,
"recurrence": { "interval": 260 },
"until_age": { "value": 260 }
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(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)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}Authorizations
Body
application/json
⌘I
Change a medical protocol
curl --request PATCH \
--url https://{organization}.rescueconsole.com/api/animals/medical-protocols/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"age_band": "<string>",
"is_active": true,
"items": [
{
"name": "<string>",
"catalogue_item_id": "<string>",
"day_offset": 1825,
"recurrence": {
"interval": 260
},
"until_age": {
"value": 260
}
}
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
age_band: '<string>',
is_active: true,
items: [
{
name: '<string>',
catalogue_item_id: '<string>',
day_offset: 1825,
recurrence: {interval: 260},
until_age: {value: 260}
}
]
})
};
fetch('https://{organization}.rescueconsole.com/api/animals/medical-protocols/{id}', 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/{id}"
payload = {
"name": "<string>",
"age_band": "<string>",
"is_active": True,
"items": [
{
"name": "<string>",
"catalogue_item_id": "<string>",
"day_offset": 1825,
"recurrence": { "interval": 260 },
"until_age": { "value": 260 }
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(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)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}
