<?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: Converting from V1 to V2 in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Converting-from-V1-to-V2/m-p/186565#M7923</link>
    <description>&lt;P&gt;I'm not sure why you're getting that error, since you appear to be sending a request body.&lt;/P&gt;
&lt;P&gt;But note that you're missing this:&lt;/P&gt;
&lt;PRE&gt;req.setRequestHeader "Content-Type", "application/json"&lt;/PRE&gt;
&lt;P&gt;and this line:&lt;/P&gt;
&lt;PRE&gt;req.send (arg)&lt;/PRE&gt;
&lt;P&gt;should&amp;nbsp;really be this (but I don't think the extra parentheses are&amp;nbsp;causing issues):&lt;/P&gt;
&lt;PRE&gt;req.send arg&lt;/PRE&gt;</description>
    <pubDate>Tue, 30 Aug 2016 23:30:08 GMT</pubDate>
    <dc:creator>Steve M.</dc:creator>
    <dc:date>2016-08-30T23:30:08Z</dc:date>
    <item>
      <title>Converting from V1 to V2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Converting-from-V1-to-V2/m-p/186564#M7922</link>
      <description>&lt;P&gt;Working in VBA.&lt;/P&gt;
&lt;P&gt;The following V1 code works:&lt;/P&gt;
&lt;PRE&gt;Sub DeleteFile(filename As String)&lt;BR /&gt;    Dim req As MSXML2.ServerXMLHTTP60&lt;BR /&gt;    Dim Result As String&lt;BR /&gt;    Dim Pos1 As Integer&lt;BR /&gt;    Dim Pos2 As Integer&lt;BR /&gt;    Set req = New MSXML2.ServerXMLHTTP60&lt;BR /&gt;    req.Open "POST", "&lt;A href="https://api.dropboxapi.com/1/fileops/delete?path=" rel="nofollow noreferrer" target="_blank"&gt;https://api.dropboxapi.com/1/fileops/delete?path=&lt;/A&gt;" &amp;amp; "/" &amp;amp; filename &amp;amp; "&amp;amp;root=auto", False&lt;BR /&gt;    req.setRequestHeader "Authorization", "Bearer ##########"&lt;BR /&gt;    req.send&lt;BR /&gt; &lt;BR /&gt;    If req.Status = 200 Then&lt;BR /&gt;       Debug.Print req.responseText&lt;BR /&gt;    Else&lt;BR /&gt;       MsgBox req.Status &amp;amp; ": " &amp;amp; req.statusText&lt;BR /&gt;       Debug.Print req.responseText&lt;BR /&gt;    End If&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following conversion to V2 does not work:&lt;/P&gt;
&lt;PRE&gt;Sub DeleteFile2(filename As String)&lt;BR /&gt;    Dim req As MSXML2.ServerXMLHTTP60&lt;BR /&gt;    Dim Result As String&lt;BR /&gt;    Dim Pos1 As Integer&lt;BR /&gt;    Dim Pos2 As Integer&lt;BR /&gt;    Set req = New MSXML2.ServerXMLHTTP60&lt;BR /&gt;    Dim arg As String&lt;BR /&gt;    arg = "{""path"": ""/" &amp;amp; filename &amp;amp; """}"&lt;BR /&gt;    req.Open "POST", "&lt;A href="https://api.dropboxapi.com/2/files/delete" rel="nofollow noreferrer" target="_blank"&gt;https://api.dropboxapi.com/2/files/delete&lt;/A&gt;", False&lt;BR /&gt;    req.setRequestHeader "Authorization", "Bearer ##########"&lt;BR /&gt;    req.send (arg)&lt;BR /&gt; &lt;BR /&gt;    If req.Status = 200 Then&lt;BR /&gt;        Debug.Print req.responseText&lt;BR /&gt;    Else&lt;BR /&gt;        MsgBox req.Status &amp;amp; ": " &amp;amp; req.statusText&lt;BR /&gt;        Debug.Print req.responseText&lt;BR /&gt;    End If&lt;BR /&gt;End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;The error I get is:&lt;/P&gt;
&lt;P&gt;"Error in call to API function "files/delete": This function requires its argument in the HTTP request body, but your request body is empty."&lt;/P&gt;
&lt;P&gt;Similar problem implementing other file functions.&lt;/P&gt;
&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:30:26 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Converting-from-V1-to-V2/m-p/186564#M7922</guid>
      <dc:creator>ERS R.</dc:creator>
      <dc:date>2019-05-29T09:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from V1 to V2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Converting-from-V1-to-V2/m-p/186565#M7923</link>
      <description>&lt;P&gt;I'm not sure why you're getting that error, since you appear to be sending a request body.&lt;/P&gt;
&lt;P&gt;But note that you're missing this:&lt;/P&gt;
&lt;PRE&gt;req.setRequestHeader "Content-Type", "application/json"&lt;/PRE&gt;
&lt;P&gt;and this line:&lt;/P&gt;
&lt;PRE&gt;req.send (arg)&lt;/PRE&gt;
&lt;P&gt;should&amp;nbsp;really be this (but I don't think the extra parentheses are&amp;nbsp;causing issues):&lt;/P&gt;
&lt;PRE&gt;req.send arg&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Aug 2016 23:30:08 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Converting-from-V1-to-V2/m-p/186565#M7923</guid>
      <dc:creator>Steve M.</dc:creator>
      <dc:date>2016-08-30T23:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from V1 to V2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Converting-from-V1-to-V2/m-p/186566#M7924</link>
      <description>&lt;PRE&gt;req.send (arg) was just because it wasn't working...originally I had it w/o parenthesis.&lt;BR /&gt;&lt;BR /&gt;However, adding req.setRequestHeader "Content-Type", "application/json" fixed the issue.  Thank you very much.&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Aug 2016 23:44:01 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Converting-from-V1-to-V2/m-p/186566#M7924</guid>
      <dc:creator>ERS R.</dc:creator>
      <dc:date>2016-08-30T23:44:01Z</dc:date>
    </item>
  </channel>
</rss>

