LoginSignup
3
0

More than 3 years have passed since last update.

Health Planet API でトークンのリフレッシュ

Posted at

Health Planet API で refresh_token の使い方

Health Planet API で Access Token の期限切れとなった場合、以下のパラメーターを POST することで、Access Toke をリレッシュできる。
https://www.healthplanet.jp/apis/api.html 参照

パラメータ
client_id アプリケーションの client_id
client_secret アプリケーションの client_secret
redirect_uri 処理完了時、もしくはエラー発生時のリターンURL。アプリケーション登録にて指定したドメインのURLもしくは https://www.healthplanet.jp/success.html が指定可能
grant_type "refresh_token"
refresh_token Access Token 取得時に一緒に返されて refresh_token の値

Access Token 取得時にしているする "code" の代わりに、"refresh_token" を指定することと、"grant_type" として "refresh_token" を指定すればリフレッシュできました。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0