<?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 Error in call to API function &amp;quot;file_requests/create&amp;quot; in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-call-to-API-function-quot-file-requests-create-quot/m-p/506226#M25029</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Soooo.... this has been driving me nuts for the past day or two. I am sure I am missing something obvious, but I have no other paths forward. So here goes. I have created an app. And I am trying to create file request through curl using the token I created.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But i am getting Error:--&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Error in call to API function "file_requests/create": This function requires its argument in the HTTP request body, but your request body is empty.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Code bellow. Please help!!!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;$api_url="&lt;A href="https://api.dropboxapi.com/2/file_requests/create" target="_blank" rel="noopener"&gt;https://api.dropboxapi.com/2/file_requests/create&lt;/A&gt;";&lt;BR /&gt;$bauthtoken='';&lt;BR /&gt;$eheader = array(&lt;BR /&gt;'Content_Type: application/json',&lt;BR /&gt;'Authorization: Bearer '.$bauthtoken,&lt;BR /&gt;'data:{"title": "Ste","destination": "/File Requests/Ste","deadline": {"deadline": "2020-03-22T17:00:00Z","allow_late_uploads": "seven_days"},"open": true}'&lt;BR /&gt;);&lt;BR /&gt;$ch = curl_init($api_url);&lt;BR /&gt;curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");&lt;BR /&gt;curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);&lt;BR /&gt;curl_setopt($ch, CURLOPT_HTTPHEADER, $eheader);&lt;BR /&gt;curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);&lt;BR /&gt;curl_setopt($ch, CURLOPT_VERBOSE, true);&lt;BR /&gt;$result = curl_exec($ch);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Mar 2021 13:39:32 GMT</pubDate>
    <dc:creator>amitjoshi1514</dc:creator>
    <dc:date>2021-03-19T13:39:32Z</dc:date>
    <item>
      <title>Error in call to API function "file_requests/create"</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-call-to-API-function-quot-file-requests-create-quot/m-p/506226#M25029</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Soooo.... this has been driving me nuts for the past day or two. I am sure I am missing something obvious, but I have no other paths forward. So here goes. I have created an app. And I am trying to create file request through curl using the token I created.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But i am getting Error:--&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Error in call to API function "file_requests/create": This function requires its argument in the HTTP request body, but your request body is empty.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Code bellow. Please help!!!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;$api_url="&lt;A href="https://api.dropboxapi.com/2/file_requests/create" target="_blank" rel="noopener"&gt;https://api.dropboxapi.com/2/file_requests/create&lt;/A&gt;";&lt;BR /&gt;$bauthtoken='';&lt;BR /&gt;$eheader = array(&lt;BR /&gt;'Content_Type: application/json',&lt;BR /&gt;'Authorization: Bearer '.$bauthtoken,&lt;BR /&gt;'data:{"title": "Ste","destination": "/File Requests/Ste","deadline": {"deadline": "2020-03-22T17:00:00Z","allow_late_uploads": "seven_days"},"open": true}'&lt;BR /&gt;);&lt;BR /&gt;$ch = curl_init($api_url);&lt;BR /&gt;curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");&lt;BR /&gt;curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);&lt;BR /&gt;curl_setopt($ch, CURLOPT_HTTPHEADER, $eheader);&lt;BR /&gt;curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);&lt;BR /&gt;curl_setopt($ch, CURLOPT_VERBOSE, true);&lt;BR /&gt;$result = curl_exec($ch);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 13:39:32 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-call-to-API-function-quot-file-requests-create-quot/m-p/506226#M25029</guid>
      <dc:creator>amitjoshi1514</dc:creator>
      <dc:date>2021-03-19T13:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error in call to API function "file_requests/create"</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-call-to-API-function-quot-file-requests-create-quot/m-p/506321#M25032</link>
      <description>&lt;P&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#file_requests-create" target="_self"&gt;The /2/file_requests/create endpoint&lt;/A&gt; is an "&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#formats" target="_self"&gt;RPC&lt;/A&gt;" style endpoint, meaning that it takes takes its parameters as JSON sent in the request body.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking at your code, I see you seem to be sending your JSON parameters in a header (named 'data'), not in the request body. You'll need to move that to the request body, via whatever mechanism your HTTP client offers. For curl in PHP, you'll likely want to use the 'CURLOPT_POSTFIELDS' option.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, note that the content type header name should be "Content-Type", not "Content_Type".&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 15:51:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-call-to-API-function-quot-file-requests-create-quot/m-p/506321#M25032</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-03-19T15:51:16Z</dc:date>
    </item>
  </channel>
</rss>

