トークン発行
POSThttps://auth.agribus-connect.net/token
OAuth 2.0 のトークンエンドポイント。application/x-www-form-urlencoded で grant_type を指定する。
認可コードフロー (authorization_code) では code・redirect_uri・client_id・client_secret (PKCE の場合は code_verifier) を送る。
リフレッシュは refresh_token。
認証
なし
パラメータ
なし
リクエストボディ
application/x-www-form-urlencoded *
| 名前 | 型 | 説明 |
|---|---|---|
grant_type * | string | authorization_coderefresh_tokenclient_credentials |
code | string | 認可コード (authorization_code) |
redirect_uri | string | 認可リクエストと同じリダイレクト URI |
client_id | string | |
client_secret | string | |
code_verifier | string | PKCE の code_verifier |
refresh_token | string | リフレッシュトークン (refresh_token) |
scope | string | 要求スコープ (スペース区切り) |
curl の例
curl -X POST 'https://auth.agribus-connect.net/token' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=authorization_code' \
-d 'code=<code>' \
-d 'redirect_uri=<redirect_uri>' \
-d 'client_id=<client_id>' \
-d 'client_secret=<client_secret>'レスポンス
200 — OK · application/json TokenResponse
{
"accessToken": "string",
"refreshToken": "string",
"accessTokenExpiredAt": "2016-01-01T00:00:00.000Z",
"refreshTokenExpiredAt": "2016-01-01T00:00:00.000Z"
}