Agrobox GSMBOX API
This article descripbes the API structure to able to add enviromental sensor metrics to Agrobox.gr platoform.
Αυτός ο οδηγός ειναι διαθέσιμος και στα Ελληνικά
Don't you have API KEY? Register for developers
URL API: https://app.agrobox.gr/gsmbox.php
Method: POST
API Call parameters
Parameter | Description | Required | Type | Default Vlaue |
key | User API Key | yes | string | |
boxkey | GSM BOX Key | yes | string | |
format | Response format | no | string | json |
task | API action | no | string | addmetric |
stype | Sensor Data | yes | array http query | |
vbat | Battery Level | no | integer (0-100) | |
signal | Signal Level | no | integer (0-100) | |
simnumber | Sim Card Number | no | string (15) | |
version | Version of software | no | string (format 1.0.0) |
Sensor Types (stype)
Number | Description |
1 | AIR TEMPERTURE (Unit Celcius) |
2 | AIR HUMMIDITY (Unit %) |
3 | SOIL TEMPERTURE (Unit Celcius) |
4 | SOIL HUMMIDITY (Unit %) |
5 | CLOUDS |
6 | PRESSURE |
7 | LEAF MOISTURE (Unit %) |
8 | RADIATION |
9 | WIND |
10 | RAIN LEVEL |
11 | Ph (min 0, max 14) |
12 | EC (mS/cm) |
13 | LEAF TEMPERTURE (Μονάδα Celcius) (min -50, max 60) |
Body Request
key=USER_API_KEY&boxkey=GSM_BOX_KEY&stype[N1]=N1_V1,N1_V2&stype[N2]=N2_V1&vbat=VBAT_LEVEL&format=json
Example
Air Temperture & Hummidity (single values)
key=abd123xxxxxxx&boxkey=12sdsd12&stype[1]=20.30&stype[2]=70&vbat=80&signal=63
You can send multiple values per sensor type seperating the values by commas.
Example: 2 temperture sensors, and 2 hummidiy sensors. Decimal seperator is the dot (.)
key=abd123xxxxxxx&boxkey=12sdsd12&stype[1]=20.30,18.93&stype[2]=70,76
Maintain the same order, if for any reason the sensor unable to read environment data. For example the 1st temperture sensor is not connected, so can't read any value. To keep same order, just set empty or include the word "false"
key=abd123xxxxxxx&boxkey=12sdsd12&stype[1]=false,18.93&stype[2]=70,76