Lock

Set a PIN

POST/api/lock
Admin. Needs an unlock token (x-tempolight-token) while a PIN lock is set; without a lock, anyone can call it.

Locks settings with a PIN and answers a token so you stay unlocked. Every other token is logged out.

Request body application/json

pinstringrequired

4 to 8 digits.

Pattern ^\d{4,8}$

Responses

200OKapplication/json
lockedboolean
tokenstring
400The body isn't valid JSON, or a value is wrong.application/json
errorstringrequired

What went wrong, in a sentence for people.

403Locked, or not allowed.application/json
errorstringrequired

What went wrong, in a sentence for people.

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