cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

トークンの有効期限

トークンの有効期限

hideki_miura
New member | Level 2

APIトークンの有効期限について
年契約して一年後に更新した場合にAPIのトークンも取り直しど変わるのでしょうか

2 Replies 2

Greg-DB
Dropbox Staff

Dropbox APIアクセストークンの有効期限は、Dropboxアカウントのプラン/契約の影響を受けません。

 

Dropboxには、長寿命と短寿命の2種類のアクセストークンがあることに注意してください。 Dropboxは、有効期間の長いアクセストークンではなく、有効期間の短いアクセストークン(およびオプションの更新トークン)のみを発行するように切り替え中です。 この移行の詳細については、こちらをご覧ください。有効期限の長いアクセストークンは自動的に期限切れになりません。短期間のアクセストークンは数時間有効であり、APIはアプリが依存する必要のある正確な有効期限情報を返します。短期間のアクセストークンは、「sl」で識別できます。プレフィックス。

ただし、アプリは「オフライン」アクセスをリクエストすることで長期アクセスを取得できます。その場合、アプリは「更新トークン」を受け取ります。このトークンを使用すると、ユーザーが手動で介入しなくても、必要に応じて新しい短期間のアクセストークンを取得できます。詳細については、 OAuthガイド認証ドキュメントをご覧ください。

参考までに、新しい長期アクセストークンの作成は廃止されましたが、現在、既存の長期アクセストークンを無効にする計画はありません。 (変更された場合は、もちろん事前にお知らせします。)その場合、既存の長期アクセストークンがあれば、中断することなく引き続き使用できます。
-----------–
読みやすい翻訳をご提供できず申し訳ございません。当社からの返答にはオンライン翻訳を使用しています。どの言語にも対応することが理想ではありますが、現時点ではそれが可能ではありません。こちらが英語版です。 
-----------–
Please excuse our translations. Our responses were created using an online translator. We'd like to support every language, but we're not currently equipped to do so. Here is the English version:
-----------–

The expiration of Dropbox API access tokens is not affected by the plan/contract of the Dropbox account.

 

Note that Dropbox has two different types of access tokens: long-lived and short-lived. Dropbox is in the process of switching to only issuing short-lived access tokens (and optional refresh tokens) instead of long-lived access tokens. You can find more information on this migration here. Long-lived access tokens do not expire automatically. Short-lived access tokens are valid for several hours, and the API returns the exact expiration information that apps should rely on. Short-lived access tokens can be identified by the "sl." prefix.

Apps can still get long-term access by requesting "offline" access though, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. You can find more information in the OAuth Guide and authorization documentation.

For reference, while the creation of new long-lived access tokens is now deprecated, we don't currently have a plan to disable existing long-lived access tokens. (If that changes, we will of course announce that ahead of time.) That being the case, you can continue using existing long-lived access token(s) without interruption, if you have any.

tkbuild
Explorer | Level 3

DropboxApi でリフレッシュトークンから使い捨てのアクセストークンを再発行しますが、

その際にアクセストークン有効期限を短くする方法を探しています

現状は8時間となっているので、可能であれば5分程度に抑えたい

 

 

 

<Curl>

curl https://api.dropbox.com/oauth2/token \
-d refresh_token=REFRESHTOKENHERE \
-d grant_type=refresh_token \
-d client_id=APPKEYHERE \
-d client_secret=APPSECRETHERE


{
    "uid": "11111111111111", 
    "access_token": "Your_Access_token", 
    "expires_in": 14400, 
    "token_type": "bearer", 
    "scope": "files.content.read files.metadata.read sharing.read sharing.write", 
}

 

 

 

 

参考

Dropbox API: アプリの権限とアクセス トークンの移行(3-4)

 

  ※参考先には有効期限の設定方法が乗っているが、

   現在のDropboxApiの画面には存在しなくなっている

 

宜しくお願い致します。

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    tkbuild Explorer | Level 3
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?