Replace age groups
curl --request PUT \
--url https://{organization}.rescueconsole.com/api/animals/age-groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"groups": {
"": [
{
"value": "baby",
"label": "Baby",
"upper": {
"value": 1,
"unit": "year"
}
},
{
"value": "young",
"label": "Young",
"upper": {
"value": 3,
"unit": "year"
}
},
{
"value": "adult",
"label": "Adult",
"upper": {
"value": 7,
"unit": "year"
}
},
{
"value": "senior",
"label": "Senior",
"upper": null
}
],
"rabbit": [
{
"value": "kit",
"label": "Kit",
"upper": {
"value": 6,
"unit": "month"
}
},
{
"value": "adult",
"label": "Adult",
"upper": {
"value": 5,
"unit": "year"
}
},
{
"value": "senior",
"label": "Senior",
"upper": null
}
]
}
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
groups: {
'': [
{value: 'baby', label: 'Baby', upper: {value: 1, unit: 'year'}},
{value: 'young', label: 'Young', upper: {value: 3, unit: 'year'}},
{value: 'adult', label: 'Adult', upper: {value: 7, unit: 'year'}},
{value: 'senior', label: 'Senior', upper: null}
],
rabbit: [
{value: 'kit', label: 'Kit', upper: {value: 6, unit: 'month'}},
{value: 'adult', label: 'Adult', upper: {value: 5, unit: 'year'}},
{value: 'senior', label: 'Senior', upper: null}
]
}
})
};
fetch('https://{organization}.rescueconsole.com/api/animals/age-groups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/animals/age-groups"
payload = { "groups": {
"": [
{
"value": "baby",
"label": "Baby",
"upper": {
"value": 1,
"unit": "year"
}
},
{
"value": "young",
"label": "Young",
"upper": {
"value": 3,
"unit": "year"
}
},
{
"value": "adult",
"label": "Adult",
"upper": {
"value": 7,
"unit": "year"
}
},
{
"value": "senior",
"label": "Senior",
"upper": None
}
],
"rabbit": [
{
"value": "kit",
"label": "Kit",
"upper": {
"value": 6,
"unit": "month"
}
},
{
"value": "adult",
"label": "Adult",
"upper": {
"value": 5,
"unit": "year"
}
},
{
"value": "senior",
"label": "Senior",
"upper": None
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"groups": {},
"units": [
"day"
],
"in_use_by_fees": [
"<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)"
}Age groups
Replace age groups
Replaces every age group for every species with what you send. A species you leave out, or send as an empty list, loses its own groups and falls back to the every-species set, or to the built-in four when there is none. Within a species the groups go youngest first; each ends where you say, the next starts there, and the last must have no upper age. A group that a fee rule names cannot be removed (409). Needs write on Animals.
PUT
/
api
/
animals
/
age-groups
Replace age groups
curl --request PUT \
--url https://{organization}.rescueconsole.com/api/animals/age-groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"groups": {
"": [
{
"value": "baby",
"label": "Baby",
"upper": {
"value": 1,
"unit": "year"
}
},
{
"value": "young",
"label": "Young",
"upper": {
"value": 3,
"unit": "year"
}
},
{
"value": "adult",
"label": "Adult",
"upper": {
"value": 7,
"unit": "year"
}
},
{
"value": "senior",
"label": "Senior",
"upper": null
}
],
"rabbit": [
{
"value": "kit",
"label": "Kit",
"upper": {
"value": 6,
"unit": "month"
}
},
{
"value": "adult",
"label": "Adult",
"upper": {
"value": 5,
"unit": "year"
}
},
{
"value": "senior",
"label": "Senior",
"upper": null
}
]
}
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
groups: {
'': [
{value: 'baby', label: 'Baby', upper: {value: 1, unit: 'year'}},
{value: 'young', label: 'Young', upper: {value: 3, unit: 'year'}},
{value: 'adult', label: 'Adult', upper: {value: 7, unit: 'year'}},
{value: 'senior', label: 'Senior', upper: null}
],
rabbit: [
{value: 'kit', label: 'Kit', upper: {value: 6, unit: 'month'}},
{value: 'adult', label: 'Adult', upper: {value: 5, unit: 'year'}},
{value: 'senior', label: 'Senior', upper: null}
]
}
})
};
fetch('https://{organization}.rescueconsole.com/api/animals/age-groups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/animals/age-groups"
payload = { "groups": {
"": [
{
"value": "baby",
"label": "Baby",
"upper": {
"value": 1,
"unit": "year"
}
},
{
"value": "young",
"label": "Young",
"upper": {
"value": 3,
"unit": "year"
}
},
{
"value": "adult",
"label": "Adult",
"upper": {
"value": 7,
"unit": "year"
}
},
{
"value": "senior",
"label": "Senior",
"upper": None
}
],
"rabbit": [
{
"value": "kit",
"label": "Kit",
"upper": {
"value": 6,
"unit": "month"
}
},
{
"value": "adult",
"label": "Adult",
"upper": {
"value": 5,
"unit": "year"
}
},
{
"value": "senior",
"label": "Senior",
"upper": None
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"groups": {},
"units": [
"day"
],
"in_use_by_fees": [
"<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)"
}Authorizations
An API key from Settings, API keys. It starts with rc_live_.
Body
application/json
Keyed by species key, or a species name such as Dogs, which is saved as its key. The key "" is the set for every species without its own. Each list goes youngest first.
Show child attributes
Show child attributes
Response
The age groups, as they now are.