简体   繁体   中英

What is the life time of downloadUrl obtain using Microsoft Graph?

What is the life time of @microsoft.graph.downloadUrl obtain when get the item from one drive using Microsoft Graph API.

In Microsoft Graph API documentation it only explain that the value is available of short period of time

The @microsoft.graph.downloadUrl value is a short-lived URL and can't be cached. The URL will only be available for a short period of time before it is invalidated.

But i am unable to find the time after which it is invalidated.

So, Can anyone help me to find that time?

Is that time is equal to the access token expire time which by default is 1 hr?

Also once the downloadURL is invalidated, do we need to request the API for other downloadUrl or is there any other way to download the item?

Pre-authenticated download URLs are only valid for a short period of time (a few minutes) and do not require an Authorization header to download.

Quoted from this

Anmol is correct , we do not publish the TTL beyond "a few minutes".

To answer the second part of your question, once a URI becomes invalid there is no way to recover that URI. You would need to reissue a pre-authenticated download URI via the API.

The assumption here is that the file will be downloaded almost immediately after the URI is issued. We keep it alive for a few minutes since there are always edge cases that might inadvertently delay downloading (ie hotel wifi, accidentally putting your machine to sleep, the battery died before you found a plug, all of the above...).

If you need a more permanent URI, you should create a link instead.

(edit: fixed broken link)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM