Browse the docs

POST /inbox/{id}/answer

Answers an Inbox question with one of its buttons.

Details #

The body names the button. by says who is answering (mac, iphone or cli; anything else is recorded as cli).

curl -s -X POST -H "Authorization: Bearer $TOKEN" -d '{"button":"Archive","by":"cli"}' http://127.0.0.1:48080/inbox/3f9a1c2b-.../answer

The response is the question with its answer, answeredBy and answeredAt.

Parameters #

curl --unix-socket "$SWITCHBOARD_HOME/engine.sock" -X POST http://localhost/inbox/{id}/answer

Answer one Inbox question with one of its buttons. The Unix socket needs no token; loopback 127.0.0.1:48080 needs Authorization: Bearer <api-token>.

Gotchas #

  • 404 for an unknown id. 400 when the question is already answered or expired, or the button is not one of its buttons.

See also #