<?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 Re: Getting a 500 error while sharing/create_shared_link_with_settings in Discuss Dropbox Developer &amp; API</title>
    <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Getting-a-500-error-while-sharing-create-shared-link-with/m-p/658561#M3185</link>
    <description>&lt;P&gt;Thanks, that's helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a file in the team space, you'll need to set the "Dropbox-API-Path-Root" accordingly in order to operate on it. The &lt;A href="https://developers.dropbox.com/dbx-team-files-guide" target="_blank"&gt;Team Files Guide&lt;/A&gt; has information on how to use that. Please update your code to set that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll also ask the team to fix up the error handling on the server to return a more useful error for this case.&lt;/P&gt;</description>
    <pubDate>Fri, 10 Feb 2023 16:39:24 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2023-02-10T16:39:24Z</dc:date>
    <item>
      <title>Getting a 500 error while sharing/create_shared_link_with_settings</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Getting-a-500-error-while-sharing-create-shared-link-with/m-p/658212#M3180</link>
      <description>&lt;P&gt;I am trying to use Google Apps Script to create Shared links. I have been able to work most of the functinality I require, incl. running "sharing/list_shared_links".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My folder is a Team folder.&amp;nbsp;Here are the important parts of "&lt;SPAN&gt;sharing/get_folder_metadata reads". At the moment I only have one file inside this folder.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"access_type": {&lt;BR /&gt;".tag": "editor"&lt;BR /&gt;},&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;"is_inside_team_folder": true,&lt;BR /&gt;"is_team_folder": false,&lt;/P&gt;&lt;P&gt;"policy": {&lt;BR /&gt;"member_policy": {&lt;BR /&gt;".tag": "anyone"&lt;BR /&gt;},&lt;BR /&gt;"resolved_member_policy": {&lt;BR /&gt;".tag": "anyone"&lt;BR /&gt;},&lt;BR /&gt;"acl_update_policy": {&lt;BR /&gt;".tag": "editors"&lt;BR /&gt;},&lt;BR /&gt;"shared_link_policy": {&lt;BR /&gt;".tag": "anyone"&lt;BR /&gt;},&lt;BR /&gt;"viewer_info_policy": {&lt;BR /&gt;".tag": "enabled"&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I try and use "create_shared_link_with_settings" I get a 500 error. At the same time, if I use the Dropbox Interface to create a View/Edit link to the file, I can use "&lt;SPAN&gt;list_shared_links" to get the link to that file.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If I authorise another member of the team to pull&amp;nbsp;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;list_shared_links", they don't see the link I created using the interface. And they surely cannot use&amp;nbsp;"create_shared_link_with_settings".&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Am I missing something critical here.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 Feb 2023 16:54:32 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Getting-a-500-error-while-sharing-create-shared-link-with/m-p/658212#M3180</guid>
      <dc:creator>SauravGhosh14</dc:creator>
      <dc:date>2023-02-09T16:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a 500 error while sharing/create_shared_link_with_settings</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Getting-a-500-error-while-sharing-create-shared-link-with/m-p/658246#M3183</link>
      <description>&lt;P&gt;A 500 error would indicate an issue on the server, so we'd need to look into that. I'll be happy to help with that, but I'll need some more information. Please reply with:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the steps to reproduce the issue with /sharing/create_shared_link_with_settings, including relevant code snippet(s), but don't include any access or refresh token(s)&lt;/LI&gt;
&lt;LI&gt;several sample 'X-Dropbox-Request-Id' response header values for the failures with a 500 code&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 09 Feb 2023 18:48:12 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Getting-a-500-error-while-sharing-create-shared-link-with/m-p/658246#M3183</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2023-02-09T18:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a 500 error while sharing/create_shared_link_with_settings</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Getting-a-500-error-while-sharing-create-shared-link-with/m-p/658518#M3184</link>
      <description>&lt;P class=""&gt;Hi&amp;nbsp;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/10"&gt;@Greg-DB&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is the code I am using&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;function generateLink_dropbox(id = "id:9TUWwcSqLjAAAAAAAAv4LA") {&lt;BR /&gt;let token = "";&lt;BR /&gt;const service = getService_();&lt;BR /&gt;token = service.getAccessToken();&lt;BR /&gt;const payload = {&lt;BR /&gt;"path": id,&lt;BR /&gt;"settings": {&lt;BR /&gt;"access": "viewer",&lt;BR /&gt;"audience": "public"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;const response = UrlFetchApp.fetch('&lt;A href="https://api.dropboxAPI.com/2/sharing/create_shared_link_with_settings" target="_blank" rel="noopener"&gt;https://api.dropboxAPI.com/2/sharing/create_shared_link_with_settings&lt;/A&gt;', {&lt;BR /&gt;'method': 'POST',&lt;BR /&gt;'payload': JSON.stringify(payload),&lt;BR /&gt;'headers': {&lt;BR /&gt;'Authorization': 'Bearer ' + token,&lt;BR /&gt;'Content-Type': 'application/json',&lt;BR /&gt;"Dropbox-API-Select-User": "dbmid:XXXX"&lt;BR /&gt;},&lt;BR /&gt;'muteHttpExceptions': true&lt;BR /&gt;});&lt;BR /&gt;const responseCode = parseInt(response.getResponseCode());&lt;BR /&gt;const responseHeaders = response.getAllHeaders();&lt;BR /&gt;Logger.log(responseCode);&lt;BR /&gt;Logger.log(responseHeaders);&lt;BR /&gt;Logger.log(response.getContentText());&lt;BR /&gt;}&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Here are a few&amp;nbsp;X-Dropbox-Request-Id as requested&lt;/P&gt;&lt;P class=""&gt;45ea2e435c134d95896dfe501678c271&lt;/P&gt;&lt;P class=""&gt;7398c989168b4f9ab573604e11dfbf13&lt;/P&gt;&lt;P class=""&gt;66c98c4fe03e4c138f50bd9a9cb79854&lt;/P&gt;&lt;P class=""&gt;5883119e3efb4ef6957bec9969eea2e7&lt;/P&gt;&lt;P class=""&gt;78c28c5a2ffe4ae4a5682785c23496d3&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;My apps script code works otherwise. I can get folder/file details. That's where I got the id of the file from.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Now, if I manually create a link in the Dropbox UI for this particular file and re run this code, I obviously get a 409 error.&lt;/P&gt;&lt;P class=""&gt;{"error_summary": "shared_link_already_exists/..", "error": {".tag": "shared_link_already_exists"}}&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;In that case, when I manually create a link from the UI, I can get "sharing/list_shared_links" to work, no issues there.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Funny thing though. Let's say I share this particular folder/file with my personal account. From my personal account, let's say I add it to my Dropbox (Join Folder). If I then run this code, "sharing/create_shared_link_with_settings" from my personal account, I can create links.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 15:09:29 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Getting-a-500-error-while-sharing-create-shared-link-with/m-p/658518#M3184</guid>
      <dc:creator>SauravGhosh14</dc:creator>
      <dc:date>2023-02-10T15:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a 500 error while sharing/create_shared_link_with_settings</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Getting-a-500-error-while-sharing-create-shared-link-with/m-p/658561#M3185</link>
      <description>&lt;P&gt;Thanks, that's helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a file in the team space, you'll need to set the "Dropbox-API-Path-Root" accordingly in order to operate on it. The &lt;A href="https://developers.dropbox.com/dbx-team-files-guide" target="_blank"&gt;Team Files Guide&lt;/A&gt; has information on how to use that. Please update your code to set that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll also ask the team to fix up the error handling on the server to return a more useful error for this case.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 16:39:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Getting-a-500-error-while-sharing-create-shared-link-with/m-p/658561#M3185</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2023-02-10T16:39:24Z</dc:date>
    </item>
  </channel>
</rss>

