Syndai Docs

Poll a CLI device login

POST
/api/v1/cli/device/token

Poll with the device_code from the login request, no more often than interval seconds. Returns 400 with error until the login is approved, then 200 with a new API key that expires after 90 days. The key is returned once: the code is spent and a later poll gets expired_token. No authentication is required.

Request Body

application/json
  1. body
device_code*string
Length1 <= length <= 200

Response Body

Request fulfilled, document follows

application/json
  1. response
api_key*string
Formatpassword
customer_id*string
Formatuuid
expires_at*string
Formatdate-time
key_id*string
Formatuuid
Example Request
curl -X POST 'https://api.syndai.ai/api/v1/cli/device/token' \  -H 'Content-Type: application/json' \  -d '{  "device_code": "string"}'
Example Response
{  "api_key": "pa$$word",  "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",  "expires_at": "2019-08-24T14:15:22Z",  "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5"}