EVer3.1.4
0x00 
2018618   2018619  , , App 2018621   20181225  API 20181227   2019121   202072   202114   202257   202388   20231024  

0x01 API
API /v3/token /v3/devices /v3/device/{sn} /v3/device/{sn}/attr /v3/device/{sn}/data /v3/device/{sn}/description /v3/device/{sn}/data/incremental /v3/device/{sn}/latest /v3/device/{sn}/data/moment/{datetime} /v3/device/webhook /v3/device/lingyun/{sn}/service /v3/device/pluviometer/{sn}/data/stats /v3/device/pluviometer/{sn}/data/history /v3/device/pluviometer/{sn}/data/latest /v3/device/{sn}/attr

  ()         App    

0x02 


HTTPURLRequestBodyPUTPOSTJSON  Authorization  /v3/token 


:
1 http://openapi.ecois.info/v3/devices?page=1&limit=20
http  openapi.ecois.info  /v3/devices  ?page=1&limit=20 URL (curl)
1 curl -H 'Content-Type: application/json' \ 2 -H 'Authorization: AccessToken' \ 3 'http://openapi.ecois.info/v3/devices?page=1&limit=100'
PostManCURL Content-Type: application/json


200 OK - [GET]Idempotent 201 CREATED - [POST/PUT/PATCH] 202 Accepted - [-] 204 NO CONTENT - [DELETE] 400 INVALID REQUEST - [POST/PUT/PATCH] 401 Unauthorized - [-] 403 Forbidden - [-] 401 404 NOT FOUND - [-] 406 Not Acceptable - [GET]XMLJSON 410 Gone -[GET] 422 Unprocesable entity - [POST/PUT/PATCH]  500 INTERNAL SERVER ERROR - [-]



1 // HTTP2xxmessage == ok

2 // message

3{

4

"message": "ok",

5

//

6}

0x03 API.


 /v3/token token token




 appid secret

 String String

  

 EID E



 token expires

 String Integer



 


1 //  2 GET http://openapi.ecois.info/v3/token?appid=test&secret=test

1 // 

2{

3

"message": "ok",

4

"token": "wj3eZGGKofgv7GyzuCmuoLukVUvUsuDq",

5

"expires": 7200

6}

0x04 API.


 /v3/devices authorized 



 page limit

 Integer Integer

  

  



 count list sn alias type_id series location authorized

status code description lng lat country province city district widget

externalAccessUrl

 Integer Array String String String String Object String
Object String String Bigdecimal Bigdecimal String String String String Object
String


1 //  2 GET http://openapi.ecois.info/v3/devices?page=2&limit=100

1 // 

2{

3

"message": "ok",

4

"count": 1,

5

"list": [

6

{

7

"sn": "00000000000000",

8

"alias": "",

9

"type": "",

        , own:, shared:             E  iframe

10

"series": "",

11

"authorized": "own",

12

"status": {

13

"code": "Fault",

14

"description": "",

15

},

16

"location": {

17

"lng": 105.6846492425,

18

"lat": 33.8720641309,

19

"country": "",

20

"province": "",

21

"city": "",

22

"district": ""

23

},

24

"widget": {

25

"externalAccessUrl": "https://www.ecois.info/path/to"

26

}

27

}

28

]

29 }

0x05 API.


/v3/device/{sn}


 sn

 String

 

 



 sn alias type series status code description lng lat country

 String String String String Object String String Bigdecimal Bigdecimal String

          

province city district authorizedUsers
authorized
name headimg feature
online rssi network
widget
externalAccessUrl

String String String Array
String
String String Object
Boolean Integer String
Object
String


1 //  2 GET http://openapi.ecois.info/v3/device/00000000000000

1 // 

2{

3

"message": "ok",

4

"sn": "00000000000000",

5

"alias": "",

6

"type": "",

7

"series": "",

8

"status": {

9

"code": "Fault",

10

"description": ""

11

},

12

"location": {

13

"lng": 105.6846492425,

14

"lat": 33.8720641309,

15

"country": "",

16

"province": "",

17

"city": "",

18

"district": ""

19

},




, authorizedshared 
, own:, shared: 

URL
/ 


 { No service
 
E  iframe

20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 }

"authorized": "own", "authorizedUsers": [
{ "openid": "s9n3n9s1zns475a", "name": "", "headimg": "URL"
} ], "feature": {
"online": false, "rssi": -56, "network":"LTE" } "widget": { "externalAccessUrl": "https://www.ecois.info/path/to" }

0x06 API.App


 /v3/device/lingyun/{sn}/service APP



 package

 String

 

name

String



params

Object




App :com.insentek.microap p.agile-irrigation

,  UrlEnocde.


1 //  2 GET http://openapi.ecois.info/v3/device/00000000000000/service?package=&name=&params=

1 // 

2{

3

"message": "ok",

4

"response": {

5

//App

6

}

7}

0x07 API.


 /v3/device/{sn}/data  /v3/device/{sn}/descriptionkeymoisturetemperature



 sn range

 String String

includeParameters

String

includeNodes

String

  





  
  
 



 total list timestamp datetime

values

 Integer Array Timestamp DateTime
Object

    2018-11-02 22:33:01 


1 //  2 GET http://openapi.ecois.info/v3/device/00000000000000/data?range=20180102,20181112&includeParameters=moisture,t

1 // 

2{

3

"message": "ok",

4

"total": 1,

5

"list": [

6

{

7

"timestamp": 1541169181,

8

"datetime": "2018-11-02 22:33:01",

9

"values": {

10

"10cm": {

11

"moisture": 12.3,

12

"temperature": 10.7

13

},

14

"20cm": {

15

"moisture": 12.3,

16

"temperature": 9.9

17

},

18

"30cm": {

19

"moisture": 12.3,

20

"temperature": 9.8

21

},

22

"40cm": {

23

"moisture": 12.3,

24

"temperature": 8.5

25

}

26

}

27

}

28

]

29 }

0x08 API.


 /v3/device/{sn}/description nodesparameters 


 sn

 String

 

 



 nodes parameters name unit type

 Array Array String String Enum

     text/numeric/binary


1 //  2 GET http://openapi.ecois.info/v3/device/00000000000000/description

1 // 

2{

3

"message": "ok",

4

"nodes": [

5

"",

6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 }

"10cm", "20cm", "30cm", "40cm" ], "parameters": [ {
"moisture": { "name": "", "unit": "%", "type": "text|numeric|binary"
}, "temperature": {
"name": "", "unit": "" } } ] ...

0x09 API.


 /v3/device/{sn}/data/incremental  3 /v3/device/{sn}/data 


 sn

 String

 

 



 lastSync

increments timestamp datetime

values

 DateTime
Array Timestamp DateTime
Object

 201811-02 22:33:01   2018-11-02 22:33:01 


1 //  2 GET http://openapi.ecois.info/v3/device/00000000000000/data/incremental

1 // 

2{

3

"message": "ok",

4

"lastSync": "2018-11-12 12:33:12",

5

"increments": [

6

{

7

"timestamp": 1541169181,

8

"datetime": "2018-11-02 22:33:01",

9

"values": {

10

"10cm": {

11

"moisture": 12.3,

12

"temperature": 8.2

13

},

14

"20cm": {

15

"moisture": 12.3,

16

"temperature": 7.6

17

},

18

"30cm": {

19

"moisture": 12.3,

20

"temperature": 7.6

21

},

22

"40cm": {

23

"moisture": 12.3,

24

"temperature": 7.5

25

}

26

}

27

}

28

]

29 }

0x10 API.


 /v3/device/{sn}/latest 


 sn

 String

 

 



 timestamp datetime

lng lat

 Timestamp DateTime
Bigdecimal Bigdecimal

  2018-11-02 22:33:01  

values

Object




1 //  2 GET http://openapi.ecois.info/v3/device/00000000000000/latest

1 // 

2{

3

"message": "ok",

4

"timestamp": 1541169181,

5

"datetime": "2018-11-02 22:33:01",

6

"lng": 105.6846492425,

7

"lat": 33.8720641309,

8

"values": {

9

"10cm": {

10

"moisture": 12.3,

11

"temperature": 8.2

12

},

13

"20cm": {

14

"moisture": 12.3,

15

"temperature": 7.6

16

},

17

"30cm": {

18

"moisture": 12.3,

19

"temperature": 7.6

20

},

21

"40cm": {

22

"moisture": 12.3,

23

"temperature": 7.5

24

}

25

}

26 }

0x11 API.


 /v3/device/{sn}/data/moment/{datetime} 



 sn datetime

 String DateTime

  


  encodeURI









timestamp datetime
values

Timestamp DateTime
Object


2018-11-02 22:33:01



1 //  2 GET http://openapi.ecois.info/v3/device/00000000000000/moment/2018-12-12%2009:32:22

1 // 

2{

3

"message": "ok",

4

"timestamp": 1541169181,

5

"datetime": "2018-11-02 22:33:01",

6

"values": {

7

"10cm": {

8

"moisture": 12.3,

9

"temperature": 8.2

10

},

11

"20cm": {

12

"moisture": 12.3,

13

"temperature": 7.6

14

},

15

"30cm": {

16

"moisture": 12.3,

17

"temperature": 7.6

18

},

19

"40cm": {

20

"moisture": 12.3,

21

"temperature": 7.5

22

}

23

}

24 }

0x12 API.


 /v3/device/webhook POSTURL  /v3/device/{sn}/data/moment/{datetime} 
510306010 30......  success 



 notifyUrl

 URL

 

 URL



1 // 

2 POST http://openapi.ecois.info/v3/device/webhook

3 postBody:{

4

"notifyUrl":"http://domain.com/path/to"

5}

0x13 API.


 /v3/device/webhook 



 notifyUrl lastModified

 URL DateTime


URL 201811-02 22:33:01


1 //  2 GET http://openapi.ecois.info/v3/device/webhook

1 // 

2{

3

"notifyUrl": "http://domain.com/path/to",

4

"lastModified": "2018-11-12 22:22:44"

5}

0x14 API.[3.1.2]


 /v3/device/pluviometer/{sn}/data/stats 



 sn range

 String String

  



  









rainfallTimes totalRainfall list beginTime endTime
duration rainfall raindropDiameter maxIntensity
maxIntensityTime state

Integer Float Array Timestamp Timestamp
Float Float Float Float
Timestamp Integer

    ,  0 /s /mm /mm  mm/min  0  1  


1 //  2 GET http://openapi.ecois.info/v3/device/pluviometer/00000000000000/data/stats

1 // 

2{

3

"message": "ok",

4

"rainfallTimes": 24,

5

"totalRainfall": 134.32,

6

"list": [

7

{

8

"beginTime": 1577030400,

9

"endTime": 1577050400,

10

"duration": 452,

11

"rainfall": 14.24,

12

"raindropDiameter": 1.13,

13

"maxIntensity": 3.15,

14

"maxIntensityTime": 1577037400,

15

"state": 1

16

}

17

... 

18

]

19 }

0x15 API.[3.1.2]

 /v3/device/pluviometer/{sn}/data/history 



 sn range

 String String

  



  



 total datapoints timeline sensors
Rainfall
AirTemperature AtmosphericPressure Humidity RainfallDuration Altitude

 Integer Array Timestamp Object
Float
Float Float Float Integer Float

       /mm / /hPa /% /s /m

RainfallRainfallDuration""


1 //  2 GET http://openapi.ecois.info/v3/device/pluviometer/00000000000000/data/history

1 // 

2{

3

"message": "ok",

4

"total": 24,

5

"datapoints": {

6

"timeline": [

7

1577030400,

8

1577037600,

9

1577044800,

10

1577052000

11

],

12

"sensors": [

13

{

14

"name": "Rainfall",

15

"values": [0, 0, 0, 0]

16

},

17

{

18

"name": "AirTemperature",

19

"values": [16.3,16.3,16.1,16]

20

},

21

{

22

"name": "AtmosphericPressure",

23

"values": [922.1,922.1,922.1,922.1]

24

},

25

{

26

"name": "Humidity",

27

"values": [53.2,63.1,63.5,73.9]

28

},

29

{

30

"name": "RainfallDuration",

31

"values": [0,0,0,0]

32

},

33

{

34

"name": "Altitude",

35

"values": [1376.8,1376.9,1376.9,1375.7]

36

}

37

]

38

}

39 }

0x16 API.[3.1.2]


 /v3/device/pluviometer/{sn}/data/latest 


 sn

 String

 

 



 latestCollectTimestamp rainfallStatus

beginTime endTime

duration rainfall raindropDiameter

 Timestamp Object
Timestamp Timestamp
Float Float Float

   null   0 /s /mm /mm

maxIntensity maxIntensityTime state datapoints

Float Timestamp Integer Object

 mm/min

0  1  
 0x15 API.  


1 //  2 GET http://openapi.ecois.info/v3/device/pluviometer/00000000000000/data/latest

1 // 

2{

3

"message": "ok",

4

"latestCollectTimestamp": 1577052000,

5

"rainfallStatus": {

6

"beginTime": 1577030400,

7

"endTime": 1577050400,

8

"duration": 452,

9

"rainfall": 14.24,

10

"raindropDiameter": 1.13,

11

"maxIntensity": 3.15,

12

"maxIntensityTime": 1577037400,

13

"state": 1

14

}

15

"datapoints": {

16

"timeline": [

17

1577052000

18

],

19

"sensors": [

20

{

21

"name": "Rainfall",

22

"values": [0]

23

},

24

{

25

"name": "AirTemperature",

26

"values": [16.3]

27

},

28

{

29

"name": "AtmosphericPressure",

30

"values": [922.1]

31

},

32

{

33

"name": "Humidity",

34

"values": [53.2]

35

},

36

{

37

"name": "RainfallDuration",

38

"values": [0]

39

},

40

{

41

"name": "Altitude",

42

"values": [1376.8]

43

}

44

]

45

}

46 }

0x17 API.[3.1.4]

POST http://openapi.ecois.info/v3/device/{sn}/attr
{sn}  

1 // namereportCycle5, 10, 20, 30, 60, 120  2 {"name": "", "reportCycle": 5}



1{ 2 3}

"message": "ok"



0x04/0x05status.code  Used Fault Online Offline Produce ToBeDelivered Repair Idle Scrap

         


0x07includeParameters -T-Z-J

 temperature moisture ec battery outsideVoltage airTemperature relativeHumidity dewPoint atmosphericPressure maxWindSpeed averageWindSpeed windDirection rainfall rainfallDuration solarRadiationIntensity solarRadiationAmount sunshineDuration pm1.0 pm2.5 pm10 tvoc laserliquidLevel

                  PM1.0 PM2.5 PM10  




1{

2 "total": 132,

3 "list": [

4

{

5

"timestamp": 1651939200,

6

"datetime": "2022-05-08 00:00:00",

7

"values": {

8

"": {

9

// 

10

"laserliquidLevel": 117.0,

11

// 

12

"battery": 3.288,

 Z Z Z Z,T Z,T T T T T T T T T T T T T T T T T J

13

// 

14

"outsideVoltage": 4.845

15

}

16

}

17

},

18

{

19

"timestamp": 1651939500,

20

"datetime": "2022-05-08 00:05:00",

21

"values": {

22

"": {

23

"laserliquidLevel": 116.7,

24

"battery": 3.288,

25

"outsideVoltage": 4.843

26

}

27

}

28

}

29 ]

30 }

