API

GET Sensors Data, POST Actuators Controls and programs
Unsplashed background img 1
GET /Courses

Response Class (Status 200)

Curl

curl -X GET --header "Accept: application/json" "http://{GatewayIP}:{port}/api/v1/courses"

Request URL

http://{GatewayIP}:{port}/api/v1/courses

Response Body

[
  {
    "id": 1,
    "geojson": {
      "lat": 0,
      "lng": 0
    },
    "name": "course1"
  },
  {
    "id": 2,
    "geojson": {
      "lat": 0,
      "lng": 0
    },
    "name": "course2"
  }
]
GET /Courses/{id}

Response Class (Status 200)

Curl

curl -X GET --header "Accept: application/json" "http://{GatewayIP}:{port}/api/v1/courses/1"

Request URL

http://{GatewayIP}:{port}/api/v1/courses/1

Response Body

{
  "id": 1,
  "geojson": {
    "lat": 0,
    "lng": 0
  },
  "name": "course1"
}

GET /Courses/{id}/exists

Response Class (Status 200)

Curl

curl -X GET --header "Accept: application/json" "http://{GatewayIP}:{port}/api/v1/courses/1/exists"

Request URL

http://{GatewayIP}:{port}/api/v1/courses/1/exists

Response Body

{
  "exists": true
}
GET /courses/{id}/sensors

Response Class (Status 200)

Curl

curl -X GET --header "Accept: application/json" "http://{GatewayIP}:{port}/api/v1/courses/1/sensors"

Request URL

http://{GatewayIP}:{port}/api/v1/courses/1/sensors

Response Body

[
  {
    "id": 6,
    "courseId": 1
  },
  {
    "id": 15,
    "courseId": 1
  }
]
GET /courses/{id}/sensors/count

Response Class (Status 200)

Curl

curl -X GET --header "Accept: application/json" "http://{GatewayIP}:{port}/api/v1/courses/1/sensors/count"

Request URL

http://{GatewayIP}:{port}/api/v1/courses/1/sensors/count

Response Body

{
  "count": 2
}
Sensors...
Unsplashed background img 3
GET /sensors

Response Class (Status 200)

Curl

curl -X GET --header "Accept: application/json" "http://{GatewayIP}:{port}/api/v1/sensors"

Request URL

http://{GatewayIP}:{port}/api/v1/sensors

Response Body

[
  {
    "id": 6,
    "courseId": 1
  },
  {
    "id": 15,
    "courseId": 1
  }
]
GET /sensors/{id}

Response Class (Status 200)

Curl

curl -X GET --header "Accept: application/json" "http://{GatewayIP}:{port}/api/v1/sensors/15"

Request URL

http://{GatewayIP}:{port}/api/v1/sensors/15

Response Body

{
  "id": 15,
  "courseId": 1
}
GET /sensors/{id}/exists

Response Class (Status 200)

Curl

curl -X GET --header "Accept: application/json" "http://{GatewayIP}:{port}/api/v1/sensors/15/exists"

Request URL

http://{GatewayIP}:{port}/api/v1/sensors/15/exists

Response Body

{
  "exists": true
}
GET /sensors/{id}/course

Response Class (Status 200)

Curl

curl -X GET --header "Accept: application/json" "http://{GatewayIP}:{port}/api/v1/sensors/15/course"

Request URL

http://{GatewayIP}:{port}/api/v1/sensors/15/course

Response Body

{
  "id": 1,
  "geojson": {
    "lat": 0,
    "lng": 0
  },
  "name": "course1"
}
GET /sensors/{id}/data

Response Class (Status 200)

Curl

curl -X GET --header "Accept: application/json" "http://{GatewayIP}:{port}/api/v1/sensors/15/data"

Request URL

http://{GatewayIP}:{port}/api/v1/sensors/15/data

Response Body

[
  {
    "temperature": 0,
    "soilMoisture1": 0,
    "soilMoisture2": -1,
    "soilMoisture3": -1,
    "updated_at": "2016-07-19T17:45:37.773Z",
    "id": "578e4b2134edcd581ac809e3",
    "sensorId": 15
  },
  {
    "temperature": 0,
    "soilMoisture1": 0,
    "soilMoisture2": -1,
    "soilMoisture3": -1,
    "updated_at": "2016-07-19T17:47:41.619Z",
    "id": "578e4b9d34edcd581ac809e6",
    "sensorId": 15
  }
]
GET /sensors/{id}/data/count

Response Class (Status 200)

Curl

curl -X GET --header "Accept: application/json" "http://{GatewayIP}:{port}/api/v1/sensors/15/data/count"

Request URL

http://{GatewayIP}:{port}/api/v1/sensors/15/data/count

Response Body

{
  "count": 925
}
GET /sensors/count

Response Class (Status 200)

Curl

curl -X GET --header "Accept: application/json" "http://{GatewayIP}:{port}/api/v1/sensors/count"

Request URL

http://{GatewayIP}:{port}/api/v1/sensors/count

Response Body

{
  "count": 2
}
Data...
Unsplashed background img 3
GET /data

Response Class (Status 200)

Curl

curl -X GET --header "Accept: application/json" "http://{GatewayIP}:{port}/api/v1/data"

Request URL

http://{GatewayIP}:{port}/api/v1/data

Response Body

  {
    "temperature": 25,
    "soilMoisture1": 90,
    "soilMoisture2": -1,
    "soilMoisture3": -1,
    "updated_at": "2016-07-19T22:10:03.706Z",
    "id": "578e891b34edcd581ac80ada",
    "sensorId": 6
  },
  {
    "temperature": 0,
    "soilMoisture1": 0,
    "soilMoisture2": -1,
    "soilMoisture3": -1,
    "updated_at": "2016-07-19T22:10:11.815Z",
    "id": "578e892334edcd581ac80adb",
    "sensorId": 15
  },
GET /data/count

Response Class (Status 200)

Curl

curl -X GET --header "Accept: application/json" "http://{GatewayIP}:{port}/api/v1/data/count"

Request URL

http://{GatewayIP}:{port}/api/v1/data/count

Response Body

{
  "count": 975
}
La mejor manera de hacer economias de agua...
Unsplashed background img 5