FoundersFounders / door-services

IoT project for the doorbell and door-open services here at FoundersFounders.
MIT License
14 stars 6 forks source link

Major overhaul to the node-backend #5

Closed DDuarte closed 8 years ago

DDuarte commented 8 years ago

The API is as follows:

GET /ping: returns 200

GET /stats: returns the number of door openings per week day and the timestamp of the first door open:

{
    "Sun": 0,
    "Mon": 24,
    "Tue": 26,
    "Wed": 30,
    "Thu": 1,
    "Fri": 0,
    "Sat": 0,
    "since": "2016-03-14T15:26:32.000Z"
}

POST /open: opens the door, params are id: the Slack user id of the person opening the door (must be in the slack channel) and secret: a "password"/token shared by the ones with access to the door. Returns some JSON user params if authorized, 401 otherwise.

The interaction with the bot on Slack was not changed. This was tested with a real slack bot however it was not tested with the doorbell itself.

luismfonseca commented 8 years ago

We've deployed this, tested and worked great.

Although few things need to be changed a bit I'm going to merge this and do the commits later so we can release the new version asap.

Good work :+1:.