We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
rahulsharma1902
2 years agoExplorer | Level 4
Use API get image name from dropbox and display in html img tag
I get image name and id from drop box using api But now I don't know how I can use this image name in img tag can you give me a public url according to that I can display this image in my html <img...
rahulsharma1902
2 years agoExplorer | Level 4
I have more query :
1. I am using access token to get image link but the access token is expire within some hours how I get long term access token ?
2. Second one Is client give me client ID and secret Id and redirect URL but when I use these credential in my device this give me error but when I replace these with my Dropbox app credential then they work fine ? should we use them in our device
Здравко
2 years agoLegendary | Level 20
rahulsharma1902, Dropbox API doesn't issue long lived access token anymore. All access token issuing at present are short lived and remain valid for 4 hours or so. For long term access, you need refresh token that doesn't expire automatic and can be used repeatedly whenever needed to "refresh" (regenerate actually) access token.
Don't mess application authentication and account (user) authentication (as you're doing)! They are different things and usually one of them cannot replace the other (as you're trying). Application authentication (app key and app secret) authenticates the application itself (as the name suggests), not some account (including the one associated with the application). Such authentication can be used only for activity unrelated to particular account content, but only to content public accessible already (like some shared links related operations). To perform account access, you need corresponding account related authentication that represent account owner granting for your application to manage the content (including your own) - access and refresh tokens.
You can let the user (again, including to yourself) to grant access permissions to your application to access owned account using OAuth flow (take a look here for a simplest example). In such a way your application ask the user for permission to access the content. Here you can Note offline access that will result in adding refresh token. If you're using some supported SDK initializing the client object properly using refresh token is enough (you don't need to perform refresh yourself), otherwise the last step in the post I linked to be comes your responsibility.
Hope this helps.
About Discuss Dropbox Developer & API
Make connections with other developers
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!