<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Use Dropbox API search results to generate dropbox.com file preview urls in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Use-Dropbox-API-search-results-to-generate-dropbox-com-file/m-p/441931#M23182</link>
    <description>&lt;P&gt;We are creating application to help users find their files/folder in dropbox.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For searching we used dropbox API route: &lt;A href="https://api.dropboxapi.com/2/files/search_v2" target="_blank" rel="noopener"&gt;https://api.dropboxapi.com/2/files/search_v2&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The goal is: based on results generate proper dropbox.com urls to let user visit dropbox site with opened file.&lt;/P&gt;
&lt;P&gt;The issue is: results do not have namespaces in their lower_path or display_path, which leads to not-existing file locations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Javascript Code (using Axios):&lt;/P&gt;
&lt;PRE&gt;const response = await userClient.post(
    '/2/files/search_v2',
    {
      query,
      options: { max_results: limit },
      match_field_options: { include_highlights: true }
    },
    {
      headers: {
        'Content-Type': 'application/json'
      }
    }
  );

  const results = response.data.matches;&lt;/PRE&gt;
&lt;P&gt;Correct behavior:&lt;/P&gt;
&lt;P&gt;user is logged in our system via oauth2. User account is simple Dropbox account, and there is basic get started file, its path from API will be&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;"path_display": "/Get Started with Dropbox.pdf"&lt;/PRE&gt;
&lt;P&gt;It's okay to generate this link: &amp;nbsp;&lt;A href="https://www.dropbox.com/home?preview=Get+Started+with+Dropbox.pdf" target="_blank" rel="noopener"&gt;https://www.dropbox.com/home?preview=Get+Started+with+Dropbox.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Incorrect behavior:&lt;/P&gt;
&lt;P&gt;User has Dropbox Business account.&lt;/P&gt;
&lt;P&gt;With Dropbox Business, each user has it's own namespace&lt;/P&gt;
&lt;P&gt;And the basic Dropbox Business file "Get Started with Dropbox.pdf" url will look something like this&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dropbox.com/home/Username?preview=Get+Started+with+Dropbox.pdf" target="_self"&gt;https://www.dropbox.com/home/Username?preview=Get+Started+with+Dropbox.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But from the API search request, it's path will be the same&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;"path_display": "/Get Started with Dropbox.pdf"&lt;/PRE&gt;
&lt;P&gt;And i see no namespace_id returned in my search query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, the question is: how to search dropbox files/folders and properly determine, to which namespace they belong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Aug 2020 14:28:07 GMT</pubDate>
    <dc:creator>qwesafesa</dc:creator>
    <dc:date>2020-08-03T14:28:07Z</dc:date>
    <item>
      <title>Use Dropbox API search results to generate dropbox.com file preview urls</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Use-Dropbox-API-search-results-to-generate-dropbox-com-file/m-p/441931#M23182</link>
      <description>&lt;P&gt;We are creating application to help users find their files/folder in dropbox.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For searching we used dropbox API route: &lt;A href="https://api.dropboxapi.com/2/files/search_v2" target="_blank" rel="noopener"&gt;https://api.dropboxapi.com/2/files/search_v2&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The goal is: based on results generate proper dropbox.com urls to let user visit dropbox site with opened file.&lt;/P&gt;
&lt;P&gt;The issue is: results do not have namespaces in their lower_path or display_path, which leads to not-existing file locations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Javascript Code (using Axios):&lt;/P&gt;
&lt;PRE&gt;const response = await userClient.post(
    '/2/files/search_v2',
    {
      query,
      options: { max_results: limit },
      match_field_options: { include_highlights: true }
    },
    {
      headers: {
        'Content-Type': 'application/json'
      }
    }
  );

  const results = response.data.matches;&lt;/PRE&gt;
&lt;P&gt;Correct behavior:&lt;/P&gt;
&lt;P&gt;user is logged in our system via oauth2. User account is simple Dropbox account, and there is basic get started file, its path from API will be&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;"path_display": "/Get Started with Dropbox.pdf"&lt;/PRE&gt;
&lt;P&gt;It's okay to generate this link: &amp;nbsp;&lt;A href="https://www.dropbox.com/home?preview=Get+Started+with+Dropbox.pdf" target="_blank" rel="noopener"&gt;https://www.dropbox.com/home?preview=Get+Started+with+Dropbox.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Incorrect behavior:&lt;/P&gt;
&lt;P&gt;User has Dropbox Business account.&lt;/P&gt;
&lt;P&gt;With Dropbox Business, each user has it's own namespace&lt;/P&gt;
&lt;P&gt;And the basic Dropbox Business file "Get Started with Dropbox.pdf" url will look something like this&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dropbox.com/home/Username?preview=Get+Started+with+Dropbox.pdf" target="_self"&gt;https://www.dropbox.com/home/Username?preview=Get+Started+with+Dropbox.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But from the API search request, it's path will be the same&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;"path_display": "/Get Started with Dropbox.pdf"&lt;/PRE&gt;
&lt;P&gt;And i see no namespace_id returned in my search query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, the question is: how to search dropbox files/folders and properly determine, to which namespace they belong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2020 14:28:07 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Use-Dropbox-API-search-results-to-generate-dropbox-com-file/m-p/441931#M23182</guid>
      <dc:creator>qwesafesa</dc:creator>
      <dc:date>2020-08-03T14:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Use Dropbox API search results to generate dropbox.com file preview urls</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Use-Dropbox-API-search-results-to-generate-dropbox-com-file/m-p/442309#M23183</link>
      <description>&lt;P&gt;Unfortunately, the Dropbox API doesn't offer an officially supported way to get or build the private Dropbox web site URL for a file or folder like this, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For reference, when calling&amp;nbsp;/2/files/search_v2, the paths in result will be relative to the root for the call (e.g., the user's own folder, or a team space, etc.), which can be specified via 'the 'Dropbox-API-Path-Root' header. If not specified, this is the user's own folder by default. Please refer to &lt;A href="https://www.dropbox.com/developers/reference/namespace-guide" target="_self"&gt;the Namespace Guide&lt;/A&gt; for more information. When applicable/present, you can also check the returned 'sharing_info' field for information about where a file/folder exists.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2020 17:22:28 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Use-Dropbox-API-search-results-to-generate-dropbox-com-file/m-p/442309#M23183</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-08-03T17:22:28Z</dc:date>
    </item>
  </channel>
</rss>

