We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here. 

Forum Discussion

Sapu21's avatar
Sapu21
Explorer | Level 3
10 months ago

Could not get preview url while searching for preview urls

I am trying to search dropbox files inside my application. Although I am bale to find the folders and the files there is no way I can get the preview url of them so that I can redirect the user to the folder on dropbox. Is there any way to do that? In the documentation I have found that the preview url in search is an optional field.

  • Sapu21 , the 'preview_url' is only available for shared items. It won’t be possible to retrieve a preview_url if the folder or file is not shared. Once you share the folder or file, the preview_url will be provided in the metadata within the response object.

    A workaround for this case would be implementing the 2/sharing/create_shared_link_with_settings endpoint to create a shared link to your file or folder. If you use the settings parameter with the value 'audience: no_one', this will set the link so that it can't be used by anyone. The link will only direct the user to the content and will not grant additional rights to the user.

  • Sapu21's avatar
    Sapu21
    Explorer | Level 3

    I am trying to search for files and folders of dropbox using the search api . Although I am able to get the files and folders, there is no way I am getting the preview url of the files and the folders which are coming up in the results. I have read the documentation where the "preview_url" field is optional. Is this still in works? Is there a workaround on how we can get the preview url of the folders sepcifically if they are not shared?

    • iNeil's avatar
      iNeil
      Icon for Dropbox Engineer rankDropbox Engineer

      Sapu21 , the 'preview_url' is only available for shared items. It won’t be possible to retrieve a preview_url if the folder or file is not shared. Once you share the folder or file, the preview_url will be provided in the metadata within the response object.

      A workaround for this case would be implementing the 2/sharing/create_shared_link_with_settings endpoint to create a shared link to your file or folder. If you use the settings parameter with the value 'audience: no_one', this will set the link so that it can't be used by anyone. The link will only direct the user to the content and will not grant additional rights to the user.

      • Sapu21's avatar
        Sapu21
        Explorer | Level 3

        Hey thanks a lot for the workaround..can this link which we are getting be used multiple times to view the file or the folder? Suppose if we store the link as a string in our db. Also can you please explain this part
         If you use the settings parameter with the value 'audience: no_one', this will set the link so that it can't be used by anyone. The link will only direct the user to the content and will not grant additional rights to the user.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,875 PostsLatest Activity: 25 minutes ago
325 Following

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 or Facebook.

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!