Change a controlled drug
Its name, form, strength, or whether it is in use. Its schedule and unit cannot change, because every entry is counted in them (400). Needs admin on Animals.
PATCH
https://{organization}.rescueconsole.com
/
api
/
animals
/
controlled-drugs
/
drugs
/
{id}
Change a controlled drug
curl --request PATCH \
--url https://{organization}.rescueconsole.com/api/animals/controlled-drugs/drugs/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"form": "<string>",
"concentration": "<string>",
"is_active": true
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', form: '<string>', concentration: '<string>', is_active: true})
};
fetch('https://{organization}.rescueconsole.com/api/animals/controlled-drugs/drugs/{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/controlled-drugs/drugs/{id}"
payload = {
"name": "<string>",
"form": "<string>",
"concentration": "<string>",
"is_active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"drug": {
"id": "<string>",
"name": "<string>",
"form": "<string>",
"concentration": "<string>",
"unit": "mL",
"schedule": "II",
"is_active": 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)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}⌘I
Change a controlled drug
curl --request PATCH \
--url https://{organization}.rescueconsole.com/api/animals/controlled-drugs/drugs/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"form": "<string>",
"concentration": "<string>",
"is_active": true
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', form: '<string>', concentration: '<string>', is_active: true})
};
fetch('https://{organization}.rescueconsole.com/api/animals/controlled-drugs/drugs/{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/controlled-drugs/drugs/{id}"
payload = {
"name": "<string>",
"form": "<string>",
"concentration": "<string>",
"is_active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"drug": {
"id": "<string>",
"name": "<string>",
"form": "<string>",
"concentration": "<string>",
"unit": "mL",
"schedule": "II",
"is_active": 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)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}
