I'm using the Dropbox PHP SDK to create a streamable link via the /media API reference, by calling createTemporaryDirectLink($path) in PHP.
Is there any chance to influence the lifetime of the link I get? Or at least something to doublecheck how long the created link will be available?
Would be awesome!
Thanks in advance,
Okay, so I found out myself how to GET the expiration date. A quick look and crawl through the code made me write this little snippet:
$response = $dbxClient->doPost(
if ($response->statusCode === 404) return null;
if ($response->statusCode !== 200) throw RequestUtil::unexpectedStatus($response);
$responseBody = json_decode($response->body);
So I learn, that expiration times are approx 4 hours. Fine! 🙂
But can I influence this?
The expiration time is always be 4 hours. There's currently no way to influence the expiration time. Why do you want to do that? Would you want to increase it or decrease it?
The expiration information for a link from /media is returned in the "expires" key in the response:
It's not currently possible to change that, but if you instead need a longer-lived link, you can use /shares instead:
Those links don't expire by default, though they can be revoked. They also point to the preview page by default, and not the file content itself, but you can modify them as necessary for that as shown here:
The api returns that URL to share https://db.tt/NInRpgMh I need the full Url when you click on that link it opens me this url https://www.dropbox.com/s/hjb603diqqv23hs/1.png?dl= 0 oh yes could use the raw = 1 , because my system is all automated and this minified link not working .
I think the only way I see based on your replays is to use:
to get a gallery view and than use curl and another function to find:
from this page.
The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.Sound good? Let's get started.
For more info on available support options, see this article.
If you found the answer to your question, please 'like' the post to say thanks to the user!