API not reporting trap sensor

Afternoon all,

I’ve just noticed that the api isn’t returning any sensor field for ‘get /traps’ as per the example responses:

[
{
“uuid”: “095be615-a8ad-4c33-8e9c-c7612fbf6c9f”,
“name”: “string”,
“tags”: [
“string”
],
“date_installed”: “2019-08-24T14:15:22Z”,
“installed_by”: “string”,
“device_model”: {
“uuid”: “095be615-a8ad-4c33-8e9c-c7612fbf6c9f”,
“name”: “string”,
“subtype”: “string”
},
“sensor”: {},
“line”: {
“uuid”: “095be615-a8ad-4c33-8e9c-c7612fbf6c9f”,
“name”: “string”
},
“project”: {
“uuid”: “095be615-a8ad-4c33-8e9c-c7612fbf6c9f”,
“name”: “string”
},
“location”: “string”,
“weight”: 0,
“images”: [
{
“uuid”: “095be615-a8ad-4c33-8e9c-c7612fbf6c9f”,
“url”: “string”,
“fid”: 0
}
],
“notes”: “string”,
“is_retired”: true,
“contact”: {
“name”: “string”,
“address”: “string”,
“email”: “string”,
“phone”: “string”
},
“meta”: {
“created”: “2019-08-24T14:15:22Z”,
“changed”: “2019-08-24T14:15:22Z”,
“owner”: {
“uuid”: “095be615-a8ad-4c33-8e9c-c7612fbf6c9f”,
“username”: “string”
},
“supplementary”: {
“parent”: “42e2bc1b-6741-4e2e-b138-97b4a342c999”
},
“originating_system”: “string”
}
}
]

Cheers,

Kieran.

Hi Kieran. This is a known limitation in the traps endpoint at the moment. It’s on the roadmap, but is a non-trivial change - we’re hoping to tackle it early next year. Depending on your exact use case, you might be able to use the GET /sensors endpoint (for sensor providers) which returns all installations with your sensor provider name. Alternatively, you might be able to use the old API which does include some sensor data. We usually advise against it as this feed is deprecated and it may be removed without warning, but we don’t expect this to happen for a least a year so If you’d like to try this option, let me know.

1 Like