cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

Re: Show Image from get_temporary_link in Apps.

Show Image from get_temporary_link in Apps.

phyopwint
Explorer | Level 3
Go to solution

I have specific dropbox folder that will include only one image at all time. My app needs to get this dropbox image and show this image in image element. Whenever dropbox image change, my app needs to reflect this updated image. 


I tried to get image using "files_get_temporary_link" API. I've got this json return. when I tried to paste "link" at address bar Ive got 404 error. Could someone tell me what I did wrong. Thank you.
 
Thank you so much.

{
  "metadata": {
    "name": "wallpaper.jpg",
    "path_lower": "/wallpaper.jpg",
    "path_display": "/wallpaper.jpg",
    "id": "id:s6F_A8pbzgAAAAAAAAAALg",
    "client_modified": "2018-07-17T08:57:12Z",
    "server_modified": "2018-07-17T08:57:24Z",
    "rev": "4d32bebe0",
    "size": 155060,
    "content_hash": "0746b8ba94f9672c23845080a01ab613445c5836aed3f445cecb09e7b68a3f71"
  },
  "link": "https://dl.dropboxusercontent.com/apitl/1/AABwcyhWG1ttuYxiN5s5OIYgaqAS86YBnRiQxpzjYNlFEGQhx38LtDIogy6c1wXjGUMVbAmHeSXx_P7bDfWt3-hVTHTBCKBbD-A-SHj0TTQEjEAW3Q8nrN-U-4OsghVsvFUhdMPeV7BCU5fiC_UC2VgrDyjMIV_Ve1072mPEJdR3tTqK-UqFytiHjcolGTapwVJtd0bGUHwNPpYrV0qJas5BZuBDICfs859JQWRBkluMi3dHUHmfFbtV4cgqNnvVomFPG8Gwpm36QQH6MkD_0xGmy-R9BYVXYd46sk3mdpX1Eg"
}

 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution
These links do expire after four hours. If you attempt to access an expired link, it will fail.

To be clear though, are you saying the returned link fails less than four hours after it was retrieved?

In general though, if you need to access file data, you should use /2/files/download. It returns the image data directly:

https://www.dropbox.com/developers/documentation/http/documentation#files-download

Or, if you need a long-lived link, you can use /2/sharing/create_shared_link_with_settings:

https://www.dropbox.com/developers/documentation/http/documentation#sharing-create_shared_link_with_...

That can be modified for different use cases as shown here:

https://www.dropbox.com/help/desktop-web/force-download

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution
These links do expire after four hours. If you attempt to access an expired link, it will fail.

To be clear though, are you saying the returned link fails less than four hours after it was retrieved?

In general though, if you need to access file data, you should use /2/files/download. It returns the image data directly:

https://www.dropbox.com/developers/documentation/http/documentation#files-download

Or, if you need a long-lived link, you can use /2/sharing/create_shared_link_with_settings:

https://www.dropbox.com/developers/documentation/http/documentation#sharing-create_shared_link_with_...

That can be modified for different use cases as shown here:

https://www.dropbox.com/help/desktop-web/force-download

phyopwint
Explorer | Level 3
Go to solution
Thank you for your solution. It was working.
Need more support?