API tokens
PreviewStart a command-line sign-in
The command line asks for a device code: a long secret it polls with (`POST /device-tokens`) and a short code,
POST
application/json- body
clientName*stringWhat the person is shown, such as the machine's name.
Length
1 <= length <= 64The codes.
application/json- response
deviceCode*stringThe secret the client polls with. Shown once.
userCode*stringThe short code a person approves, such as WDJK-4M2P.
verificationUri?stringThe web app's page to open. Absent when the server does not know the web app's address.
expiresAt*stringFormat
date-timeinterval*integerSeconds between polls.
curl -X POST 'https://wardn.example.com/api/v1/device-codes' \ -H 'Content-Type: application/json' \ -d '{ "clientName": "string"}'Example Response
{ "deviceCode": "string", "userCode": "string", "verificationUri": "string", "expiresAt": "2019-08-24T14:15:22Z", "interval": 0}A token's recent calls GET
Newest first. Every call is recorded, allowed or not; a denied call was outside what the token or its owner may do, and a limited one went over the token's rate limit.
Collect the token of a command-line sign-in POST
Answers `pending` until a person approves or denies. The approved answer carries the API token's secret once: