コンテンツにスキップ
Docs
Esc
↑↓移動↵開く⌘Jプレビュー

承認を確かめ、承認済みならCLI用のAPIキーを発行する

RFC 8628 §3.5 のエラー名を error.code に返す。キーは成功した1回の応答にだけ載り、再取得できない。

POST/cli/tokens
リクエストボディ
必須application/json
device_codestring必須
最小長 1 · 最大長 128
レスポンス
200

承認済み。期限30日・導入用の4スコープのキー。

api_keystring必須

平文のキー。この応答でしか受け取れない。

key_idstring必須
creator_idstring必須
environmentstring必須
expires_atstring<date-time>必須
400

authorization_pending(承認前)/ slow_down(間隔が5秒未満)/ access_denied(拒否)/ expired_token(期限切れ・消費済み・不明なコード)/ invalid_input。

errorobject必須
プロパティを表示
codestring必須
messagestring必須
request_idstring必須
429

rate_limited。

errorobject必須
プロパティを表示
codestring必須
messagestring必須
request_idstring必須
500

internal。

errorobject必須
プロパティを表示
codestring必須
messagestring必須
request_idstring必須
リクエスト
curl -X POST 'https://api.cozeni.net/external/v1/cli/tokens' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "device_code": "string"
}'
レスポンス
{
  "api_key": "string",
  "key_id": "string",
  "creator_id": "string",
  "environment": "string",
  "expires_at": "2019-08-24T14:15:22Z"
}

このページは役に立ちましたか?