Get the list of recorded weights
1 min
GET
/api/v1/pets/{id}/weights
Query Parameters
- filter[type]stringrequiredExampleDescription
- filter[clinic_id]integerDescription
Responses
200
- object
- dataobject
- clinic_unitstringExample
- last_weight_valuenumberExample
- weight_trend_is_upbooleanExample
- weightsobject
- dateTimesstring[]Example
[ "17-01-2020", "21-01-2020", "26-02-2020", "31-03-2020", "29-04-2020", "08-05-2020", "12-05-2020", "14-05-2020", "18-05-2020", "19-05-2020", "26-05-2020", "10-06-2020", "10-06-2020", "15-06-2020", "17-06-2020" ]
- kgnumber[]Example
[ 71, 71, 22, 20, 28, 20, 20, 22, 40, 32, 24, 30, 23, 35, 36 ]
- lbsnumber[]Example
[ 156.555, 156.555, 48.51, 44.1, 61.74, 44.1, 44.1, 48.51, 88.2, 70.56, 52.92, 66.15, 50.715, 77.175, 79.38 ]
curl
curl --request GET \
--url '/api/v1/pets/{id}/weights?filter[type]=vet' \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("/api/v1/pets/{id}/weights?filter[type]=vet", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("/api/v1/pets/{id}/weights?filter[type]=vet")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "/api/v1/pets/{id}/weights?filter[type]=vet"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// successful operation
{
"data": {
"clinic_unit": "lbs",
"last_weight_value": 79.38,
"weight_trend_is_up": true,
"weights": {
"dateTimes": [
""
],
"kg": [
0
],
"lbs": [
0
]
}
}
}