<?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 Problem with paths using create_shared_link_with_settings in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-with-paths-using-create-shared-link-with-settings/m-p/313801#M18627</link>
    <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;I'm trying to make a php code that will automatically create a shared link for the files I'm uploading and add it to an XML file.&lt;/P&gt;&lt;P&gt;Both the upload and XML file are updating correctly, but I'm stuck with the generation of the link. This is the part of code that i'm running right now:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;	$parameters = array('path' =&amp;gt; $filename);

	$headers = array('Authorization: Bearer token','Content-Type: application/json');
	$curlOptions = array(
        CURLOPT_HTTPHEADER =&amp;gt; $headers,
        CURLOPT_POST =&amp;gt; true,
        CURLOPT_POSTFIELDS =&amp;gt; json_encode($parameters),
        CURLOPT_RETURNTRANSFER =&amp;gt; true,
        CURLOPT_VERBOSE =&amp;gt; true
    );

	$ch = curl_init('https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings');
	curl_setopt_array($ch, $curlOptions);

	$linkdropbox = curl_exec($ch);
	curl_close($ch);
	$nodeDescargaText = $xml -&amp;gt; createTextNode($linkdropbox);&lt;/PRE&gt;&lt;P&gt;Filename is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;	$filename = "/".$_FILES['inputFile']['name'];&lt;/PRE&gt;&lt;P&gt;So, I keep getting errors like:&lt;/P&gt;&lt;P&gt;"The root path is unsupported"&lt;/P&gt;&lt;P&gt;"Malformed path"&lt;/P&gt;&lt;P&gt;I have tried leaving the root both with "" or with "/",&amp;nbsp; and also have tried putting in the root the name of the Apps folder, (Apps, Aplicaciones, manualesint), the last one being the folder to where are the files being uploaded. None seems to make this work. I have tried all of them both with a "/" after, before, both, or without.&lt;/P&gt;&lt;P&gt;On the upload code, I'm uploading the file using "/"+name of the file, and it's working like a charm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help will be appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:09:07 GMT</pubDate>
    <dc:creator>emarco</dc:creator>
    <dc:date>2019-05-29T09:09:07Z</dc:date>
    <item>
      <title>Problem with paths using create_shared_link_with_settings</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-with-paths-using-create-shared-link-with-settings/m-p/313801#M18627</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;I'm trying to make a php code that will automatically create a shared link for the files I'm uploading and add it to an XML file.&lt;/P&gt;&lt;P&gt;Both the upload and XML file are updating correctly, but I'm stuck with the generation of the link. This is the part of code that i'm running right now:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;	$parameters = array('path' =&amp;gt; $filename);

	$headers = array('Authorization: Bearer token','Content-Type: application/json');
	$curlOptions = array(
        CURLOPT_HTTPHEADER =&amp;gt; $headers,
        CURLOPT_POST =&amp;gt; true,
        CURLOPT_POSTFIELDS =&amp;gt; json_encode($parameters),
        CURLOPT_RETURNTRANSFER =&amp;gt; true,
        CURLOPT_VERBOSE =&amp;gt; true
    );

	$ch = curl_init('https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings');
	curl_setopt_array($ch, $curlOptions);

	$linkdropbox = curl_exec($ch);
	curl_close($ch);
	$nodeDescargaText = $xml -&amp;gt; createTextNode($linkdropbox);&lt;/PRE&gt;&lt;P&gt;Filename is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;	$filename = "/".$_FILES['inputFile']['name'];&lt;/PRE&gt;&lt;P&gt;So, I keep getting errors like:&lt;/P&gt;&lt;P&gt;"The root path is unsupported"&lt;/P&gt;&lt;P&gt;"Malformed path"&lt;/P&gt;&lt;P&gt;I have tried leaving the root both with "" or with "/",&amp;nbsp; and also have tried putting in the root the name of the Apps folder, (Apps, Aplicaciones, manualesint), the last one being the folder to where are the files being uploaded. None seems to make this work. I have tried all of them both with a "/" after, before, both, or without.&lt;/P&gt;&lt;P&gt;On the upload code, I'm uploading the file using "/"+name of the file, and it's working like a charm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help will be appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:09:07 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-with-paths-using-create-shared-link-with-settings/m-p/313801#M18627</guid>
      <dc:creator>emarco</dc:creator>
      <dc:date>2019-05-29T09:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with paths using create_shared_link_with_settings</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-with-paths-using-create-shared-link-with-settings/m-p/313846#M18630</link>
      <description>&lt;P&gt;[Cross-linking for reference:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/53499573/problem-with-paths-using-create-shared-link-with-settings" target="_blank"&gt;https://stackoverflow.com/questions/53499573/problem-with-paths-using-create-shared-link-with-settings&lt;/A&gt; ]&lt;/P&gt;
&lt;P&gt;Getting a shared link for the root is not supported, so supplying a path like "" or "/" is expected to fail like that.&lt;/P&gt;
&lt;P&gt;To get the shared link for a file, you should supply the full path to the file, including the file name and extension. For example, for a file "example.xml" in a folder "Documents", the path would be: "/Documents/example.xml".&lt;/P&gt;
&lt;P&gt;You can construct these paths manually if you want, but it's better to use the paths returned by the API itself. For instance, when uploading a file, the API returns the metadata for the uploaded file in the response body. Specifically, you should use the returned 'path_lower' value.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 15:06:29 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-with-paths-using-create-shared-link-with-settings/m-p/313846#M18630</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-11-27T15:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with paths using create_shared_link_with_settings</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-with-paths-using-create-shared-link-with-settings/m-p/314067#M18634</link>
      <description>&lt;P&gt;Hey Greg,&lt;/P&gt;&lt;P&gt;Thanks for the input, will give it a try and get back with the results!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 08:37:03 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-with-paths-using-create-shared-link-with-settings/m-p/314067#M18634</guid>
      <dc:creator>emarco</dc:creator>
      <dc:date>2018-11-28T08:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with paths using create_shared_link_with_settings</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-with-paths-using-create-shared-link-with-settings/m-p/314103#M18636</link>
      <description>&lt;P&gt;Okay, so after testing what you told me, I managed to make it "work".&lt;/P&gt;&lt;P&gt;The problem I am having now, is that I append the result into a text node, and when clicking that, I get redirected to something like:&lt;/P&gt;&lt;P&gt;&lt;A href="http://192.168.1.101/downloads/%7B%22.tag%22:%20%22file%22,%20%22url%22:%20%22https:/www.dropbox.com/s/3qy4rbv5n5nlabcm/example.xml?dl=0%22,%20%22id%22:%20%22id:7S7yO6NeNlAAAAAAAAAB_Q%22,%20%22name%22:%20%22actualizar.php%22,%20%22path_lower%22:%20%22/descargas/actualizar.php%22,%20%22link_permissions%22:%20%7B%22resolved_visibility%22:%20%7B%22.tag%22:%20%22public%22%7D,%20%22requested_visibility%22:%20%7B%22.tag%22:%20%22public%22%7D,%20%22can_revoke%22:%20true,%20%22visibility_policies%22:%20%5B%7B%22policy%22:%20%7B%22.tag%22:%20%22public%22%7D,%20%22resolved_policy%22:%20%7B%22.tag%22:%20%22public%22%7D,%20%22allowed%22:%20true%7D,%20%7B%22policy%22:%20%7B%22.tag%22:%20%22team_only%22%7D,%20%22resolved_policy%22:%20%7B%22.tag%22:%20%22team_only%22%7D,%20%22allowed%22:%20false,%20%22disallowed_reason%22:%20%7B%22.tag%22:%20%22user_not_on_team%22%7D%7D,%20%7B%22policy%22:%20%7B%22.tag%22:%20%22password%22%7D,%20%22resolved_policy%22:%20%7B%22.tag%22:%20%22password%22%7D,%20%22allowed%22:%20false,%20%22disallowed_reason%22:%20%7B%22.tag%22:%20%22user_account_type%22%7D%7D%5D,%20%22can_set_expiry%22:%20false,%20%22can_remove_expiry%22:%20true,%20%22allow_download%22:%20true,%20%22can_allow_download%22:%20true,%20%22can_disallow_download%22:%20false,%20%22allow_comments%22:%20true,%20%22team_restricts_comments%22:%20false%7D,%20%22preview_type%22:%20%22text%22,%20%22client_modified%22:%20%222018-11-28T09:55:13Z%22,%20%22server_modified%22:%20%222018-11-28T09:55:13Z%22,%20%22rev%22:%20%22016800000001031ed7a0%22,%20%22size%22:%20172%7D" target="_blank"&gt;http://192.168.1.101/downloads/%7B%22.tag%22:%20%22file%22,%20%22url%22:%20%22https:/www.dropbox.com/s/3qy4rbv5n5nlabcm/example.xml?dl=0%22,%20%22id%22:%20%22id:7S7yO6NeNlAAAAAAAAAB_Q%22,%20%22name%22:%20%22actualizar.php%22,%20%22path_lower%22:%20%22/descargas/actualizar.php%22,%20%22link_permissions%22:%20%7B%22resolved_visibility%22:%20%7B%22.tag%22:%20%22public%22%7D,%20%22requested_visibility%22:%20%7B%22.tag%22:%20%22public%22%7D,%20%22can_revoke%22:%20true,%20%22visibility_policies%22:%20%5B%7B%22policy%22:%20%7B%22.tag%22:%20%22public%22%7D,%20%22resolved_policy%22:%20%7B%22.tag%22:%20%22public%22%7D,%20%22allowed%22:%20true%7D,%20%7B%22policy%22:%20%7B%22.tag%22:%20%22team_only%22%7D,%20%22resolved_policy%22:%20%7B%22.tag%22:%20%22team_only%22%7D,%20%22allowed%22:%20false,%20%22disallowed_reason%22:%20%7B%22.tag%22:%20%22user_not_on_team%22%7D%7D,%20%7B%22policy%22:%20%7B%22.tag%22:%20%22password%22%7D,%20%22resolved_policy%22:%20%7B%22.tag%22:%20%22password%22%7D,%20%22allowed%22:%20false,%20%22disallowed_reason%22:%20%7B%22.tag%22:%20%22user_account_type%22%7D%7D%5D,%20%22can_set_expiry%22:%20false,%20%22can_remove_expiry%22:%20true,%20%22allow_download%22:%20true,%20%22can_allow_download%22:%20true,%20%22can_disallow_download%22:%20false,%20%22allow_comments%22:%20true,%20%22team_restricts_comments%22:%20false%7D,%20%22preview_type%22:%20%22text%22,%20%22client_modified%22:%20%222018-11-28T09:55:13Z%22,%20%22server_modified%22:%20%222018-11-28T09:55:13Z%22,%20%22rev%22:%20%22016800000001031ed7a0%22,%20%22size%22:%20172%7D&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Whilst, obviously, I just want the download link which is in the first line, in this case it being:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;https:/&lt;A href="http://www.dropbox.com/s/3qy4rbv5n5nlabcm/" target="_blank"&gt;www.dropbox.com/s/3qy4rbv5n5nlabcm/&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;example&lt;/SPAN&gt;&lt;SPAN&gt;.xml&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Have deleted the file since it was an example, but the link was working previously.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any idea how to just get the link back?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Really appreciating your help Greg&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 10:07:47 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-with-paths-using-create-shared-link-with-settings/m-p/314103#M18636</guid>
      <dc:creator>emarco</dc:creator>
      <dc:date>2018-11-28T10:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with paths using create_shared_link_with_settings</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-with-paths-using-create-shared-link-with-settings/m-p/314114#M18637</link>
      <description>&lt;P&gt;Managed to do that with a string filter function! Thanks a lot for your help Greg &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@FBF7D2AB59A0D6E861EBF6A36F93B7E2/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 10:33:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-with-paths-using-create-shared-link-with-settings/m-p/314114#M18637</guid>
      <dc:creator>emarco</dc:creator>
      <dc:date>2018-11-28T10:33:16Z</dc:date>
    </item>
  </channel>
</rss>

