API ReferenceVoice

Tap Yes or No on the question waiting

POST
/console/api/voice/answer

Has the same effect as saying yes or no to the one question on screen. The token comes from the voiceTurn answer that asked. A stale token gets a reply with stale true and changes nothing.

Authorization

consoleSession csrfToken
clearwake_console<token>

Set by GET /console/api/session. HttpOnly, SameSite=Strict, 8 hours.

In: cookie

X-Clearwake-CSRF<token>

The csrf value from GET /console/api/session, an HMAC of the session id. Required on every POST.

In: header

Request Body

application/json

The token of the open question and the answer.

A Yes or No tap.

token?string

Token of the open question.

answer*string

The answer.

Value in

  • "yes"
  • "no"

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/console/api/voice/answer" \  -H "Content-Type: application/json" \  -d '{    "token": "1dd2bbc8054b9b8aed09fedc",    "answer": "yes"  }'
{  "intent": "yes",  "source": "tap",  "transcript": "",  "transcript_sha256": "93c625dd555bff5f0d1f8894e90674f4ee390d4bf53f437858c1208755a03fd2",  "text": "Nothing is waiting for a yes or a no. Say a rule, a question, or an approval.",  "speak": "Nothing is waiting for a yes or a no. Say a rule, a question, or an approval.",  "needs_confirm": false,  "token": null,  "stale": true}