(+39) 345 0655553 biogents-service@ekla.it

Counter

JSON received from the API:

{
    "swagger": "2.0",
    "info": {
        "description": "Biogents BG-Counter Captures API.",
        "version": "1.0.0",
        "title": "Biogents BG-Counter",
        "contact": {
            "email": "info@biogents.com"
        }
    },
    "host": "live.bg-counter.com",
    "basePath": "\/traps",
    "tags": [
        {
            "name": "Captures",
            "description": "Get Captures for user",
            "externalDocs": {
                "description": "Find out more about BG-Counter",
                "url": "https:\/\/www.biogents.com\/bg-counter\/"
            }
        }
    ],
    "schemes": [
        "http"
    ],
    "paths": {
        "\/exportTrapCapturesForTimeframe.json": {
            "post": {
                "tags": [
                    "Captures"
                ],
                "summary": "Get all Traps with Capture Results",
                "description": "Returns a JSON structure of all Traps with the related Captures for the given time frame (max. 1000 Captures per Trap).",
                "operationId": "exportTrapCapturesForTimeframe",
                "consumes": [
                    "application\/x-www-form-urlencoded"
                ],
                "produces": [
                    "application\/json"
                ],
                "parameters": [
                    {
                        "in": "formData",
                        "name": "data[user_id]",
                        "description": "Your API Key, which can be found on your BG-Counter Profile page.",
                        "required": true,
                        "type": "string",
                        "format": "string(100)"
                    },
                    {
                        "in": "formData",
                        "name": "data[startTime]",
                        "description": "Start time of the capture events. Format: US date\/time, ie. 2018-03-20 11:20",
                        "required": true,
                        "type": "string",
                        "format": "string",
                        "default": "data[endTime] -3 months"
                    },
                    {
                        "in": "formData",
                        "name": "data[endTime]",
                        "description": "End time of the capture events. Format: US date\/time, ie. 2018-03-25 17:50",
                        "required": true,
                        "type": "string",
                        "format": "string",
                        "default": "current date"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "examples": {
                            "application\/json": {
                                "traps": [
                                    {
                                        "Trap": {
                                            "id": "10",
                                            "iccid": null,
                                            "name": "BGC2 #5b (10)",
                                            "latitude": "49.017287",
                                            "longitude": "12.112679",
                                            "transmission_time": "12:00",
                                            "co2_bottle_size": null,
                                            "co2_flow_rate": "50",
                                            "co2_refill_date": "0000-00-00 00:00:00",
                                            "modified": "2017-11-13 14:02:53",
                                            "created": "2015-07-20 09:54:09"
                                        },
                                        "Capture": [
                                            {
                                                "id": "51325",
                                                "trap_id": "10",
                                                "timestamp_start": "2015-10-13 17:13:42",
                                                "timestamp_end": "2015-10-13 17:15:00",
                                                "timestamp_sent": "2015-10-13 17:15:00",
                                                "led_status": false,
                                                "co2_status": true,
                                                "co2_consumption": null,
                                                "fan_status": "1",
                                                "counter_status": "1",
                                                "small": "0",
                                                "medium": "0",
                                                "large": "0",
                                                "temperature": "25.24",
                                                "rel_humidity": "66",
                                                "precipitation": "0",
                                                "ambient_light": "2873",
                                                "battery": "11.82",
                                                "reception": "-84",
                                                "latitude": null,
                                                "longitude": null,
                                                "isTrapExactLocation": false,
                                                "isTrapGPSDecimal": "0",
                                                "isGPSDecimal": false,
                                                "trap_latitude": null,
                                                "trap_longitude": null,
                                                "power_draw": null,
                                                "health": null,
                                                "modified": "2015-10-14 00:19:11",
                                                "created": "2015-10-14 00:19:11",
                                                "moonphase": "0"
                                            },
                                            {
                                                "id": "51326",
                                                "trap_id": "10",
                                                "timestamp_start": "2015-10-13 18:13:42",
                                                "timestamp_end": "2015-10-13 18:15:00",
                                                "timestamp_sent": "2015-10-13 18:15:00",
                                                "led_status": false,
                                                "co2_status": true,
                                                "co2_consumption": null,
                                                "fan_status": "1",
                                                "counter_status": "1",
                                                "small": "10",
                                                "medium": "8",
                                                "large": "1",
                                                "temperature": "26.04",
                                                "rel_humidity": "68",
                                                "precipitation": "0",
                                                "ambient_light": "2644",
                                                "battery": "12.65",
                                                "reception": "-84",
                                                "latitude": null,
                                                "longitude": null,
                                                "isTrapExactLocation": false,
                                                "isTrapGPSDecimal": "0",
                                                "isGPSDecimal": false,
                                                "trap_latitude": null,
                                                "trap_longitude": null,
                                                "power_draw": null,
                                                "health": null,
                                                "modified": "2015-10-14 00:19:11",
                                                "created": "2015-10-14 00:19:11",
                                                "moonphase": "0"
                                            }
                                        ]
                                    }
                                ]
                            }
                        }
                    },
                    "400": {
                        "description": "No POST data submitted \/ Invalid arguments",
                        "examples": {
                            "application\/json": {
                                "name": "Invalid arguments",
                                "message": "Invalid arguments",
                                "url": "\/traps\/exportTrapCapturesForTimeframe.json"
                            }
                        }
                    },
                    "404": {
                        "description": "No user given \/ User not found",
                        "examples": {
                            "application\/json": {
                                "name": "User not found",
                                "message": "User not found",
                                "url": "\/traps\/exportTrapCapturesForTimeframe.json"
                            }
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "traps": {
            "type": "object",
            "description": "The main array of the request. Contains multiple objects of Trap and related Capture objects. Is empty {} when no trap was found for the given user.",
            "properties": {
                "Trap": {
                    "type": "object",
                    "$ref": "#\/definitions\/Trap"
                },
                "Capture": {
                    "$ref": "#\/definitions\/Capture"
                }
            }
        },
        "Trap": {
            "type": "object",
            "description": "Trap object",
            "properties": {
                "id": {
                    "description": "The unique recordset id of the trap",
                    "type": "integer",
                    "format": "int(11)",
                    "example": 199204
                },
                "iccid": {
                    "description": "The unique serial and identification number of the trap SIM Card (Integrated Circuit Card Identifier)",
                    "type": "string",
                    "format": "string(20)",
                    "example": "012813001234567"
                },
                "name": {
                    "description": "The name of the trap set in the trap information form. Default name is the ICCID",
                    "type": "string",
                    "format": "string(255)",
                    "example": "BGC2 #5b (10)"
                },
                "latitude": {
                    "description": "The last submitted latitude of the trap. Default is the Greenwich latitude",
                    "type": "number",
                    "format": "double",
                    "example": 37.346508000000000038198777474462985992431640625
                },
                "longitude": {
                    "description": "The last submitted longitude of the trap. Default is the Greenwich longitude",
                    "type": "number",
                    "format": "double",
                    "example": -122.047492000000005418769433163106441497802734375
                },
                "transmission_time": {
                    "description": "The time when the daily raw data transmission occurs. NULL if not set",
                    "type": "string",
                    "format": "date-time",
                    "default": null,
                    "example": "18:00"
                },
                "co2_bottle_size": {
                    "description": "CO2 cylinder size in kg",
                    "type": "integer",
                    "format": "int(11)",
                    "example": "10"
                },
                "co2_flow_rate": {
                    "description": "The CO2 flow rate in g\/h",
                    "type": "integer",
                    "format": "int(11)",
                    "example": "50"
                },
                "co2_refill_date": {
                    "description": "The timestamp when the CO2 cylinder has been refilled",
                    "type": "string",
                    "format": "date-time",
                    "example": "2017-10-13 17:13:42"
                },
                "modified": {
                    "description": "The recordset last modification time",
                    "type": "string",
                    "format": "date-time",
                    "example": "2017-11-13 14:02:53"
                },
                "created": {
                    "description": "The recordset creation time",
                    "type": "string",
                    "format": "date-time",
                    "example": "2015-07-20 09:54:09"
                }
            }
        },
        "Capture": {
            "type": "object",
            "description": "Array of one or multiple capture time frames objects. Is empty [] when no capture was found"
        },
        "captures": {
            "type": "object",
            "description": "Array of one or multiple capture time frames objects. Is empty [] when no capture was found",
            "properties": {
                "id": {
                    "description": "The unique recordset id of the capture",
                    "type": "integer",
                    "format": "int(11)",
                    "example": 51325
                },
                "trap_id": {
                    "description": "The iccid of the related trap",
                    "type": "string",
                    "format": "string(20)",
                    "example": "012813001234567"
                },
                "timestamp_start": {
                    "description": "The capture start time",
                    "type": "string",
                    "format": "date-time",
                    "example": "2015-10-13 17:13:42"
                },
                "timestamp_end": {
                    "description": "The capture end time",
                    "type": "string",
                    "format": "date-time",
                    "example": "2015-10-13 17:15:00"
                },
                "timestamp_sent": {
                    "description": "The time when the trap submitted the capture data to the backend",
                    "type": "string",
                    "format": "date-time",
                    "example": "2015-10-13 17:15:00"
                },
                "led_status": {
                    "description": "The led status of the trap during the capture time frame. On = true; Off = false",
                    "type": "boolean",
                    "example": false
                },
                "co2_status": {
                    "description": "The CO2 status of the trap during the capture time frame. On = true; Off = false",
                    "type": "boolean",
                    "example": false
                },
                "co2_consumption": {
                    "description": "The CO2 consumption in mg",
                    "type": "number",
                    "format": "float",
                    "example": 10.5
                },
                "fan_status": {
                    "description": "The led status of the fan during the capture time frame. On = 1; Off = 0",
                    "type": "integer",
                    "format": "int(1)",
                    "example": 1
                },
                "counter_status": {
                    "description": "The counter status of the fan during the capture time frame. On = 1; Off = 0",
                    "type": "integer",
                    "format": "int(1)",
                    "example": 0
                },
                "small": {
                    "description": "Amount of small objects captured during the capture time frame",
                    "type": "integer",
                    "format": "int(11)",
                    "example": 51325
                },
                "medium": {
                    "description": "Amount of medium objects captured during the capture time frame",
                    "type": "integer",
                    "format": "int(11)",
                    "example": 51325
                },
                "large": {
                    "description": "Amount of large objects captured during the capture time frame",
                    "type": "integer",
                    "format": "int(11)",
                    "example": 51325
                },
                "temperature": {
                    "description": "The surrounding temperature (in percent) during the capture time frame",
                    "type": "number",
                    "format": "double",
                    "example": 66
                },
                "rel_humidity": {
                    "description": "The relative humidity (in degrees Celsius) during the capture time frame",
                    "type": "number",
                    "format": "double",
                    "example": 25.239999999999998436805981327779591083526611328125
                },
                "ambient_light": {
                    "description": "The ambient light (in lux) during the capture time frame",
                    "type": "number",
                    "format": "double",
                    "example": 2873
                },
                "battery": {
                    "description": "The battery level (in volt) during the capture time frame",
                    "type": "number",
                    "format": "double",
                    "example": 11.82000000000000028421709430404007434844970703125
                },
                "reception": {
                    "description": "The cell reception quality (in decibel) during the capture time frame",
                    "type": "number",
                    "format": "float",
                    "example": -84
                },
                "power_draw": {
                    "description": "The power draw (in milli Ampere) during the capture time frame",
                    "type": "number",
                    "format": "float",
                    "example": 296.31000000000000227373675443232059478759765625
                },
                "moonphase": {
                    "description": "The moonphase during the capture time frame. Float value between 0 and 1; 0 = new moon; 0.5 at first and last quarter; 1 at full moon",
                    "type": "number",
                    "format": "float",
                    "example": 0.5
                },
                "health": {
                    "description": "A string for additional or health information of the trap",
                    "type": "string",
                    "format": "string(255)",
                    "example": "Trap is fine"
                },
                "latitude": {
                    "description": "The transmitted latitude (might vary from the exact location)",
                    "type": "number",
                    "format": "double",
                    "example": 37.346508000000000038198777474462985992431640625
                },
                "longitude": {
                    "description": "The transmitted longitude (might vary from the exact location)",
                    "type": "number",
                    "format": "double",
                    "example": -122.047492000000005418769433163106441497802734375
                },
                "isTrapExactLocation": {
                    "description": "Flag if the user has set the trap location manually in the backend",
                    "type": "boolean",
                    "example": false
                },
                "isTrapGPSDecimal": {
                    "description": "1 if the original trap coordinates sent in decimal format; 0 if they are sent in degrees\/minutes format",
                    "type": "integer",
                    "format": "int(1)",
                    "example": 1
                },
                "isGPSDecimal": {
                    "description": "1 if the capture coordinates sent in decimal format; 0 if they are sent in degrees\/minutes format",
                    "type": "boolean",
                    "example": false
                },
                "trap_latitude": {
                    "description": "The correct latitude (converted into decimal if transmitted in degrees\/minutes and checked against the tolerrant radius)",
                    "type": "number",
                    "format": "double",
                    "example": 37.346508000000000038198777474462985992431640625
                },
                "trap_longitude": {
                    "description": "The correct latitude (converted into decimal if transmitted in degrees\/minutes and checked against the tolerrant radius)",
                    "type": "number",
                    "format": "double",
                    "example": -122.047492000000005418769433163106441497802734375
                },
                "modified": {
                    "description": "The recordset last modification time",
                    "type": "string",
                    "format": "date-time",
                    "example": "2015-10-14 00:19:11"
                },
                "created": {
                    "description": "The recordset creation time",
                    "type": "string",
                    "format": "date-time",
                    "example": "2015-10-14 00:19:11"
                }
            }
        }
    }
}
start:
level2:
id: , type: