1.2.2. Captures¶
-
GET
/captures
¶ Get a list of captures for a tag
- Query Parameters
serial (string) – Tag serial (Required)
offset (integer) – Return samples starting from this index.
limit (integer) – Limit the number of samples returned.
Example request:
GET /captures?serial=string HTTP/1.1 Host: example.com
- Status Codes
200 OK –
A capture object
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "batvoltagemv": 1, "tagserial": "string", "cursorpos": 1, "id": 1, "loopcount": 1, "md5": "string", "status": { "brownout": true, "clockfail": true, "id": 1, "lpm5wakeup": true, "misc": true, "parent_capture": 1, "resetsalltime": 1, "supervisor": true, "watchdog": true }, "timeintmins": 1, "timestamp": "2020-08-27T10:57:29.275611", "version": 1 }
invalid input, object invalid
Example response:
HTTP/1.1 400 Bad Request Content-Type: application/json {}
Tag with serial not found.
Example response:
HTTP/1.1 404 Not Found Content-Type: application/json {}
-
POST
/captures
¶ Create a capture
- Status Codes
200 OK –
A capture object
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "batvoltagemv": 1, "tagserial": "string", "cursorpos": 1, "id": 1, "loopcount": 1, "md5": "string", "status": { "brownout": true, "clockfail": true, "id": 1, "lpm5wakeup": true, "misc": true, "parent_capture": 1, "resetsalltime": 1, "supervisor": true, "watchdog": true }, "timeintmins": 1, "timestamp": "2020-08-27T10:57:29.275611", "version": 1 }
invalid input, object invalid
Example response:
HTTP/1.1 400 Bad Request Content-Type: application/json {}
Not authorised. HMAC does not correspond to input data.
Example response:
HTTP/1.1 401 Unauthorized Content-Type: application/json {}
Tag not found
Example response:
HTTP/1.1 404 Not Found Content-Type: application/json {}
Conflict. A capture with this HMAC already exists. Dead battery or replay attack.
Example response:
HTTP/1.1 409 Conflict Content-Type: application/json {}
-
GET
/captures/{id}
¶ Get a capture by ID
Example request:
GET /captures/{id} HTTP/1.1 Host: example.com
- Status Codes
200 OK –
A capture object
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "batvoltagemv": 1, "tagserial": "string", "cursorpos": 1, "id": 1, "loopcount": 1, "md5": "string", "status": { "brownout": true, "clockfail": true, "id": 1, "lpm5wakeup": true, "misc": true, "parent_capture": 1, "resetsalltime": 1, "supervisor": true, "watchdog": true }, "timeintmins": 1, "timestamp": "2020-08-27T10:57:29.275611", "version": 1 }
invalid input, object invalid
Example response:
HTTP/1.1 400 Bad Request Content-Type: application/json {}
Capture not found.
Example response:
HTTP/1.1 404 Not Found Content-Type: application/json {}
1.2.2.1. Samples¶
Returns samples for a given capture.
-
GET
/captures/{id}/samples
¶ Get samples for a capture.
- Query Parameters
offset (integer) – Return samples starting from this index.
limit (integer) – Limit the number of samples returned.
Example request:
GET /captures/{id}/samples HTTP/1.1 Host: example.com
- Status Codes
200 OK –
A list of sample objects
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "capture_id": 1, "id": 1, "location": { "capturesample_id": 1, "description": "string", "id": 1, "timestamp": "2020-08-27T10:57:29.275611" }, "rh": 1.0, "temp": 1.0, "timestamp": "2020-08-27T10:57:29.275611" } ]
bad input parameter
Example response:
HTTP/1.1 400 Bad Request Content-Type: application/json {}