Lock

Unlock

POST/api/unlock
Open. Open to everyone who can reach Tempolight.

Answers a token valid for 12 hours: send it as the x-tempolight-token header (or ?token=). Each try takes 300 ms. Tokens are kept in memory, so a restart logs everyone out.

Request body application/json

pinstringrequired

Responses

200OKapplication/json
tokenstring
403Locked, or not allowed.application/json
errorstringrequired

What went wrong, in a sentence for people.

Request
curl -X POST 'http://localhost:8080/api/unlock' \
  -H 'content-type: application/json' \
  -d '{
  "pin": "1234"
}'
Response
{
  "token": "5f2d8a9c1e7b4f60"
}
Edit on GitHub