Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

API Design #1

Description

@sondr3

REQUIRED:

  • Real-time coffee information
  • Historical coffee information
  • System information
  • Version API

WANTED:

  • Card scanning information

NOTES:

  • Only GET requests

DESIGN:
Route design: /v1/coffee/<year>/<month>/<day>.

Example, GET /v1/coffee:

{
  "time": "20190120T120345Z1",
  "coffee": {
    "temperature": 1000,
    "cups": -10,
    "amount": 1,
  },
  "mocca": {
    "isPowered": true,
    "startedBrewing": "20190120T120345Z1",
    "lostPower": true,
    "outages": {
      ["20190120T120345Z1", "20190120T120345Z1"],
      ["20190120T120345Z1", "20190120T120345Z1"],
    },
  }
}

If lostPower is true, outages returns a list where the first element is when it was powered on and the second element is when it was powered off. If lostPower is false, outages returns null.

Example, GET /v1/coffee/2019/01/16:

{
  "20190120T120345Z1": {
    "time": "20190120T120345Z1",
  "coffee": {
    "temperature": 1000,
    "cups": -10,
    "amount": 1,
  },
  "mocca": {
    "isPowered": true,
    "startedBrewing": "20190120T120345Z1",
    "lostPower": true,
    "outages": {
      ["20190120T120345Z1", "20190120T120345Z1"],
      ["20190120T120345Z1", "20190120T120345Z1"],
    },
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions