Set an animal's diet
curl --request PUT \
--url https://{organization}.rescueconsole.com/api/animals/animals/{id}/diet \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"brand": "Contoso Pantry",
"formula": "Adult salmon and rice",
"daily_total": "2 cups",
"treats": "Two small biscuits",
"stock_on_hand": "Half a bag",
"daily_cost_cents": 185,
"restrictions": [
"No chicken"
]
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
brand: 'Contoso Pantry',
formula: 'Adult salmon and rice',
daily_total: '2 cups',
treats: 'Two small biscuits',
stock_on_hand: 'Half a bag',
daily_cost_cents: 185,
restrictions: ['No chicken']
})
};
fetch('https://{organization}.rescueconsole.com/api/animals/animals/{id}/diet', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/animals/animals/{id}/diet"
payload = {
"brand": "Contoso Pantry",
"formula": "Adult salmon and rice",
"daily_total": "2 cups",
"treats": "Two small biscuits",
"stock_on_hand": "Half a bag",
"daily_cost_cents": 185,
"restrictions": ["No chicken"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"items": [
{
"id": "<string>",
"kind": "food",
"name": "<string>",
"amount": "<string>",
"schedule_note": "<string>",
"sort_order": 123
}
],
"diet": {
"brand": "<string>",
"formula": "<string>",
"daily_total": "<string>",
"treats": "<string>",
"stock_on_hand": "<string>",
"daily_cost_cents": 1,
"restrictions": [
"<string>"
],
"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)"
}Animal nutrition
Set an animal's diet
Saves the diet as a whole: a field you leave out, or send empty, is cleared. Needs write on Animals.
PUT
/
api
/
animals
/
animals
/
{id}
/
diet
Set an animal's diet
curl --request PUT \
--url https://{organization}.rescueconsole.com/api/animals/animals/{id}/diet \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"brand": "Contoso Pantry",
"formula": "Adult salmon and rice",
"daily_total": "2 cups",
"treats": "Two small biscuits",
"stock_on_hand": "Half a bag",
"daily_cost_cents": 185,
"restrictions": [
"No chicken"
]
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
brand: 'Contoso Pantry',
formula: 'Adult salmon and rice',
daily_total: '2 cups',
treats: 'Two small biscuits',
stock_on_hand: 'Half a bag',
daily_cost_cents: 185,
restrictions: ['No chicken']
})
};
fetch('https://{organization}.rescueconsole.com/api/animals/animals/{id}/diet', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/animals/animals/{id}/diet"
payload = {
"brand": "Contoso Pantry",
"formula": "Adult salmon and rice",
"daily_total": "2 cups",
"treats": "Two small biscuits",
"stock_on_hand": "Half a bag",
"daily_cost_cents": 185,
"restrictions": ["No chicken"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"items": [
{
"id": "<string>",
"kind": "food",
"name": "<string>",
"amount": "<string>",
"schedule_note": "<string>",
"sort_order": 123
}
],
"diet": {
"brand": "<string>",
"formula": "<string>",
"daily_total": "<string>",
"treats": "<string>",
"stock_on_hand": "<string>",
"daily_cost_cents": 1,
"restrictions": [
"<string>"
],
"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
An API key from Settings, API keys. It starts with rc_live_.
Path Parameters
The animal's record ID (not its Pet ID).
Body
application/json