OAuth2 API : Retrieve access token by refresh token

POST /api/1/oauth2/token

Access Tokenが有効期限を超過している場合、このAPIによってリフレッシュ処理を行なう必要がある。 Access Tokenの有効期限は数十分程度だが、Refresh Tokenの有効期限は数日間程度となっている。 このAPIを呼び出す場合は、事前に他の OAuth2 API によって有効なRefresh Tokenを取得済みでなければならない。

Parameters

Key Value デフォルト値
grant_type 権限付与種別。refresh_token を指定する
client_id 事前に割り当てられたClient ID
client_secret 事前に割り当てられたClient Secret
refresh_token Refresh Token

Request

Route

POST /api/1/oauth2/token

Headers

Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: THIS_IS_SESSION_COOKIE_KEY_FOR_SPEC=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTM1NzIyNTYxNmI2OTk2NGM5NWViNDEzOTAwZDlkOWQwBjsAVEkiGGtwaV9wcmV2X2NvbnRyb2xsZXIGOwBGSSIWYXBpL3Rva2VucyNjcmVhdGUGOwBG--0dc393eef7e56e28bbf7acb0762e178de9815a1e
Origin: 

Body

grant_type=refresh_token
client_id=test_identifier
client_secret=test_secret
refresh_token=ff90c1aea7f7707330e9af1cc3594b53

Response

Headers

Content-Type: application/json; charset=utf-8
X-Ua-Compatible: IE=Edge,chrome=1
E-Tag: "d949456a81f13e119c77c4e822dac606"
Cache-Control: max-age=0, private, must-revalidate
X-Request: 05b2aade436c2cb785c5ce7a019dbf1f
X-Runtime: 0.033224
Content-Length: 142

Status

200 OK

Body

フォーマット:
{
  "access_token": "fce32526162300c717f2370121d865b1",
  "token_type": "bearer",
  "expires_in": 3599,
  "refresh_token": "ff90c1aea7f7707330e9af1cc3594b53"
}