Set location preferences
curl --request PUT \
--url https://{organization}.rescueconsole.com/api/shifts/location-preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"person_id": "4f8b2d6a-9e1c-4a3f-8b7d-5c2e6a9f1b04",
"location_unit_ids": [
"6d1a9f3c-8e5b-4b2d-a7c9-4e1f6b3d8a52",
"8f2c5a7e-1b9d-4c3a-b8e6-7a4d2f9c1e63"
],
"remote": true
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
person_id: '4f8b2d6a-9e1c-4a3f-8b7d-5c2e6a9f1b04',
location_unit_ids: ['6d1a9f3c-8e5b-4b2d-a7c9-4e1f6b3d8a52', '8f2c5a7e-1b9d-4c3a-b8e6-7a4d2f9c1e63'],
remote: true
})
};
fetch('https://{organization}.rescueconsole.com/api/shifts/location-preferences', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/shifts/location-preferences"
payload = {
"person_id": "4f8b2d6a-9e1c-4a3f-8b7d-5c2e6a9f1b04",
"location_unit_ids": ["6d1a9f3c-8e5b-4b2d-a7c9-4e1f6b3d8a52", "8f2c5a7e-1b9d-4c3a-b8e6-7a4d2f9c1e63"],
"remote": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"person_id": "<string>",
"location_unit_ids": [
"<string>"
],
"locations": [
{
"id": "<string>",
"name": "<string>"
}
],
"remote": true
}{
"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)"
}Volunteers
Set location preferences
Replaces a volunteer’s whole list of preferred locations, and whether they will work remotely. Every location is checked before anything changes. Needs write on Shifts.
A coordinator’s: needs write on Shifts AND read on People. A key without read on People is refused (403) with “Only a coordinator can do this: it needs permission to see People.”
PUT
/
api
/
shifts
/
location-preferences
Set location preferences
curl --request PUT \
--url https://{organization}.rescueconsole.com/api/shifts/location-preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"person_id": "4f8b2d6a-9e1c-4a3f-8b7d-5c2e6a9f1b04",
"location_unit_ids": [
"6d1a9f3c-8e5b-4b2d-a7c9-4e1f6b3d8a52",
"8f2c5a7e-1b9d-4c3a-b8e6-7a4d2f9c1e63"
],
"remote": true
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
person_id: '4f8b2d6a-9e1c-4a3f-8b7d-5c2e6a9f1b04',
location_unit_ids: ['6d1a9f3c-8e5b-4b2d-a7c9-4e1f6b3d8a52', '8f2c5a7e-1b9d-4c3a-b8e6-7a4d2f9c1e63'],
remote: true
})
};
fetch('https://{organization}.rescueconsole.com/api/shifts/location-preferences', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/shifts/location-preferences"
payload = {
"person_id": "4f8b2d6a-9e1c-4a3f-8b7d-5c2e6a9f1b04",
"location_unit_ids": ["6d1a9f3c-8e5b-4b2d-a7c9-4e1f6b3d8a52", "8f2c5a7e-1b9d-4c3a-b8e6-7a4d2f9c1e63"],
"remote": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"person_id": "<string>",
"location_unit_ids": [
"<string>"
],
"locations": [
{
"id": "<string>",
"name": "<string>"
}
],
"remote": true
}{
"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