Equipment
List meters
Retrieve a paginated list of meters
GET
/
meters
List meters
curl --request GET \
--url https://api.oncanary.com/v1/meters \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.oncanary.com/v1/meters', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.oncanary.com/v1/meters"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"meter_type": "numeric",
"unit": "hours",
"custom_unit": "<string>",
"category": "manual",
"frequency": "<string>",
"frequency_interval": 2,
"asset_id": "<string>",
"location_id": "<string>",
"current_value": 123,
"current_reading_at": "2023-11-07T05:31:56Z",
"min_value": 123,
"max_value": 123,
"rollover_value": 123,
"image_url": "<string>",
"is_active": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"meta": {
"request_id": "<string>",
"api_version": "<string>",
"pagination": {
"has_more": true,
"cursor": "<string>",
"total_count": 1
}
}
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}Authorizations
Organization API key with an sk_live_ or sk_test_ prefix
Query Parameters
Maximum number of items to return from a Canary-native list (1-100)
Required range:
1 <= x <= 100Pagination cursor from previous response
Sort direction
Available options:
asc, desc Filter by meter type
Available options:
numeric, boolean Filter by category
Available options:
manual, automated Filter by asset ID
Filter by location ID
⌘I
List meters
curl --request GET \
--url https://api.oncanary.com/v1/meters \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.oncanary.com/v1/meters', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.oncanary.com/v1/meters"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"meter_type": "numeric",
"unit": "hours",
"custom_unit": "<string>",
"category": "manual",
"frequency": "<string>",
"frequency_interval": 2,
"asset_id": "<string>",
"location_id": "<string>",
"current_value": 123,
"current_reading_at": "2023-11-07T05:31:56Z",
"min_value": 123,
"max_value": 123,
"rollover_value": 123,
"image_url": "<string>",
"is_active": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"meta": {
"request_id": "<string>",
"api_version": "<string>",
"pagination": {
"has_more": true,
"cursor": "<string>",
"total_count": 1
}
}
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}