<?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: Need Help ON API HTTP POST in Discuss Dropbox Developer &amp; API</title>
    <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Need-Help-ON-API-HTTP-POST/m-p/449116#M1456</link>
    <description>&lt;P&gt;Thanks so much for your help on this.. I did get it working oK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Aug 2020 18:51:08 GMT</pubDate>
    <dc:creator>athnetix</dc:creator>
    <dc:date>2020-08-28T18:51:08Z</dc:date>
    <item>
      <title>Need Help ON API HTTP POST</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Need-Help-ON-API-HTTP-POST/m-p/447316#M1447</link>
      <description>&lt;P&gt;Brand new user to DropBox API and have run into a issue trying to run an API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to get thru the Auth2 verification OK in my code and now want to just run a simple API.&lt;/P&gt;&lt;P&gt;So I tried with the API:&amp;nbsp; &lt;A href="https://api.dropboxapi.com/2/file_requests/count" target="_blank" rel="noopener"&gt;https://api.dropboxapi.com/2/file_requests/count&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I constructed a HTTP POST request as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12&lt;/P&gt;&lt;P&gt;Dim hwrequest As Net.HttpWebRequest = Net.HttpWebRequest.Create("&lt;A href="https://api.dropboxapi.com/2/file_requests/count" target="_blank" rel="noopener"&gt;https://api.dropboxapi.com/2/file_requests/count&lt;/A&gt;")&lt;BR /&gt;hwrequest.UserAgent = "http_requester/0.1"&lt;BR /&gt;hwrequest.Timeout = 60000&lt;BR /&gt;hwrequest.Headers.Add(stoken) ----stoken is in JSON format&lt;BR /&gt;hwrequest.Method = "POST"&lt;BR /&gt;hwrequest.ContentType = "application/json"&lt;/P&gt;&lt;P&gt;Dim hwresponse As Net.HttpWebResponse = hwrequest.GetResponse()&lt;BR /&gt;If hwresponse.StatusCode = Net.HttpStatusCode.OK Then&lt;BR /&gt;Dim responseStream1 As IO.StreamReader = _&lt;BR /&gt;New IO.StreamReader(hwresponse.GetResponseStream())&lt;BR /&gt;Dim responseData1 = responseStream1.ReadToEnd()&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run this I get an error: &lt;SPAN&gt;Specified value has invalid HTTP Header characters. Parameter name: name&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now looking at the documenation it seems that the Header I added needs to be in a json format, which I did.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question if I added the authorization as a header is it true it needs to be in JSON format.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help wiould be great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 18:56:00 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Need-Help-ON-API-HTTP-POST/m-p/447316#M1447</guid>
      <dc:creator>athnetix</dc:creator>
      <dc:date>2020-08-21T18:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help ON API HTTP POST</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Need-Help-ON-API-HTTP-POST/m-p/447885#M1449</link>
      <description>&lt;P&gt;No, the "Authorization" header value should not be JSON. It should be plain text of the format:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Bearer ACCESS_TOKEN_HERE&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can find an example of what a call to&amp;nbsp;/2/file_requests/count would look like using curl in &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#file_requests-count" target="_self"&gt;the documentation&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For reference,&amp;nbsp;/2/file_requests/count is an &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#formats" target="_self"&gt;"RPC" style endpoint&lt;/A&gt;, so any API call parameters (separate from the Authorization) it takes would be expected as JSON in the request body, not a header. Note that&amp;nbsp;/2/file_requests/count in particular doesn't take any API call parameters anyway though, so you don't need to supply a request body when calling it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2020 14:50:55 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Need-Help-ON-API-HTTP-POST/m-p/447885#M1449</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-08-24T14:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help ON API HTTP POST</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Need-Help-ON-API-HTTP-POST/m-p/449116#M1456</link>
      <description>&lt;P&gt;Thanks so much for your help on this.. I did get it working oK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 18:51:08 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Need-Help-ON-API-HTTP-POST/m-p/449116#M1456</guid>
      <dc:creator>athnetix</dc:creator>
      <dc:date>2020-08-28T18:51:08Z</dc:date>
    </item>
  </channel>
</rss>

