<?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: API delete by id:# via CURL in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-delete-by-id-via-CURL/m-p/753499#M33012</link>
    <description>&lt;P&gt;I just took the code section from the dev API example... here are the args that is getting sent by FileMaker using it's "Insert from URL" script step:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;-X POST
 --header "Content-Type: application/json"
 --header "Authorization: Bearer &amp;lt;redacted&amp;gt;"
 --header "Dropbox-API-Arg: {\"path\":\"id:m5ktIrz8BXoAAAAbAAAASg\"}"
--dump-header&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Feb 2024 23:11:14 GMT</pubDate>
    <dc:creator>Wookiee</dc:creator>
    <dc:date>2024-02-26T23:11:14Z</dc:date>
    <item>
      <title>API delete by id:# via CURL</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-delete-by-id-via-CURL/m-p/753475#M33010</link>
      <description>&lt;P&gt;In one script in my FileMaker database solution, I upload a file to a constructed path, then save the unique id:xxxxxxxxxxxxxxxx number for that record, to tie the record to the file in the DropBox directory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In another script, I wanted to delete the file by id:xxxxxxxxxxxxx and not by path. If I understand&amp;nbsp;&lt;STRONG&gt;pathString(pattern="(/(.|[\r\n])*)|(ns:[0-9]+(/.*)?)|(id:.*)")&lt;/STRONG&gt; correctly, I should be able to do this, no?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl -X POST https://api.dropboxapi.com/2/files/delete_v2 \
    --header "Authorization: Bearer &amp;lt;get access token&amp;gt;" \
    --header "Content-Type: application/json" \
    --data "{\"path\":\"$idDBX"}"

//where $idDBX is the stored value of id:xxxxxxxxxxxxx&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result I get returned is "Error in call to API function "files/delete:2": Unexpected HTTP headers: "Dropbox-Api-Arg""&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2024 22:20:40 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-delete-by-id-via-CURL/m-p/753475#M33010</guid>
      <dc:creator>Wookiee</dc:creator>
      <dc:date>2024-02-26T22:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: API delete by id:# via CURL</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-delete-by-id-via-CURL/m-p/753497#M33011</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1792302"&gt;@Wookiee&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Are you sure, you have executed exactly that curl command you posted and not something else? &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@9AD39CA637682E9616FBE31CDAF1B6C4/emoticons/1f914.png" alt=":thinking_face:" title=":thinking_face:" /&gt; Why do I ask? The error message states that you have passed "Dropbox-Api-Arg" header, but it's missing on your post! &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@488936AC5FA64023548E32631AFD9803/emoticons/1f600.png" alt=":grinning_face:" title=":grinning_face:" /&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2024 22:46:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-delete-by-id-via-CURL/m-p/753497#M33011</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2024-02-26T22:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: API delete by id:# via CURL</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-delete-by-id-via-CURL/m-p/753499#M33012</link>
      <description>&lt;P&gt;I just took the code section from the dev API example... here are the args that is getting sent by FileMaker using it's "Insert from URL" script step:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;-X POST
 --header "Content-Type: application/json"
 --header "Authorization: Bearer &amp;lt;redacted&amp;gt;"
 --header "Dropbox-API-Arg: {\"path\":\"id:m5ktIrz8BXoAAAAbAAAASg\"}"
--dump-header&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2024 23:11:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-delete-by-id-via-CURL/m-p/753499#M33012</guid>
      <dc:creator>Wookiee</dc:creator>
      <dc:date>2024-02-26T23:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: API delete by id:# via CURL</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-delete-by-id-via-CURL/m-p/753500#M33013</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1792302"&gt;@Wookiee&lt;/a&gt;, The question of mine was rhetoric! I hoped it'll direct you. Ok... can you see the difference of your 2 posts and figure out alone what's different and wrong or...?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS: Everywhere some path can be used, the equivalent id can be used too. Even more a hybrid form may be used too: id of a folder followed by a relative path. In all cases that's NOT the issue (I assume the id is correct).&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2024 23:31:47 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-delete-by-id-via-CURL/m-p/753500#M33013</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2024-02-26T23:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: API delete by id:# via CURL</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-delete-by-id-via-CURL/m-p/753505#M33014</link>
      <description>&lt;P&gt;Not quite there yet, but you have me on the right path, I think...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="data-data-data-rdj.gif" style="width: 498px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/44250i156E81989DB1070D/image-size/large?v=v2&amp;amp;px=999" role="button" title="data-data-data-rdj.gif" alt="data-data-data-rdj.gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2024 23:34:55 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-delete-by-id-via-CURL/m-p/753505#M33014</guid>
      <dc:creator>Wookiee</dc:creator>
      <dc:date>2024-02-26T23:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: API delete by id:# via CURL</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-delete-by-id-via-CURL/m-p/753643#M33018</link>
      <description>&lt;P&gt;Hello &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1792302"&gt;@Wookiee&lt;/a&gt;, &lt;BR /&gt;&lt;BR /&gt;The error "Unexpected HTTP headers: 'Dropbox-Api-Arg'" indicates that the HTTP request you sent includes a header that the server is not expecting or does not recognize, as mentioned by Здравко. For example, --header "Dropbox-API-Arg: {\"path\":\"id:m5ktIrz8BXoAAAAbAAAASg\"}". &lt;BR /&gt;&lt;BR /&gt;Please note that the &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-upload" target="_blank"&gt;/2/files/upload&lt;/A&gt; and &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-delete" target="_blank"&gt;/2/files/delete_v2&lt;/A&gt; endpoints have different formats when including parameters. The &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-upload" target="_blank"&gt;/2/files/upload&lt;/A&gt; endpoint uses the header "Dropbox-API-Arg," while the &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-delete" target="_blank"&gt;/2/files/delete_v2&lt;/A&gt; endpoint uses the request body data. Below is an example of how to implement the &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-delete" target="_blank"&gt;/2/files/delete_v2&lt;/A&gt; endpoint using the request body data via cURL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl -X POST \
--header "Authorization: Bearer " \
--header "Content-Type: application/json" \
--data "{\"path\":\"id:m5ktIrz8BXoAAAAbAAAASg\"}" \
https://api.dropboxapi.com/2/files/delete_v2&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 16:22:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-delete-by-id-via-CURL/m-p/753643#M33018</guid>
      <dc:creator>iNeil</dc:creator>
      <dc:date>2024-02-27T16:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: API delete by id:# via CURL</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-delete-by-id-via-CURL/m-p/753649#M33019</link>
      <description>&lt;P&gt;Thank you both! The following worked perfectly in FileMaker to delete the file. Putting this here for anyone who might need it.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"-X POST" &amp;amp; ¶ &amp;amp;
" --header \"Content-Type: application/json\"" &amp;amp; ¶ &amp;amp;
" --header \"Authorization: Bearer " &amp;amp; $authToken &amp;amp; "\"" &amp;amp; ¶ &amp;amp;
" --data \"" &amp;amp; $dropboxArgJSON &amp;amp; "\"" &amp;amp; ¶ &amp;amp;
"--dump-header $responseHeaders"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 16:52:55 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-delete-by-id-via-CURL/m-p/753649#M33019</guid>
      <dc:creator>Wookiee</dc:creator>
      <dc:date>2024-02-27T16:52:55Z</dc:date>
    </item>
  </channel>
</rss>

