Skip to content

Instantly share code, notes, and snippets.

@michaelsauter
Last active October 17, 2019 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelsauter/3590a001990f31ceb679b511d7fce670 to your computer and use it in GitHub Desktop.
Save michaelsauter/3590a001990f31ceb679b511d7fce670 to your computer and use it in GitHub Desktop.

Interview Task

Objective

As a Farmera developer, synchronize temperature data reliably from an external vendor, myfarm.io, with Farmera. What kind of concepts / entities do you need to implement in our service? How will you do the interaction with myfarm.io? If you need more information about the API, please ask.

API Documentation myfarm.io

Example request

curl 'https://api.myfarm.io/devices/123/temperature?start=2019-01-06T00%3A00%3A00Z&end=2019-01-09T00%3A00%3A00Z&groupBy=FIFTEEN_MINUTES' -i -u 'user:secret' -X GET

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
  "start": "2019-01-06T00:00:00",
  "end": "2019-01-06T00:40:00",
  "groupBy": "FIFTEEN_MINUTES",
  "data": [
    {
      "time": "2019-01-06T00:15",
      "avg": 70,
      "min": 68,
      "max": 71.5,
    },
    {
      "time": "2019-01-06T00:30",
      "avg": 69,
      "min": 67,
      "max": 70,
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment