<?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 Empty response for /get_current_account in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Empty-response-for-get-current-account/m-p/288393#M17643</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;some years ago I used the dropbox Api v1 and now I try to switch to v2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I managed to get the authorization done but now I'm struggeling with the /get_current_account endpoint.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my php looks like that:&lt;/P&gt;&lt;PRE&gt;public static function dropboxAuthorize($token) {		
	$curl = curl_init();
	curl_setopt($curl, CURLOPT_VERBOSE, 1);
	curl_setopt_array($curl, array(
	  CURLOPT_URL =&amp;gt; "https://api.dropbox.com/2/users/get_current_account",
	  CURLOPT_RETURNTRANSFER =&amp;gt; true,
	  CURLOPT_ENCODING =&amp;gt; "",
	  CURLOPT_NOBODY =&amp;gt; true,
	  CURLOPT_MAXREDIRS =&amp;gt; 10,
	  CURLOPT_TIMEOUT =&amp;gt; 50,
	  CURLOPT_HTTP_VERSION =&amp;gt; CURL_HTTP_VERSION_1_1,
	  CURLOPT_CUSTOMREQUEST =&amp;gt; "POST",
	  CURLOPT_HTTPHEADER =&amp;gt; array(
		"authorization: Bearer " . $token,
		"cache-control: no-cache",
		"content-type: application/json"
	  ),
	));

	$response = curl_exec($curl);
}&lt;/PRE&gt;&lt;P&gt;The response is empty! Not false or anything else. I get no erros and don't know what's wrong.&lt;/P&gt;&lt;P&gt;If I send the request via Postman I get the correct response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my var_dump of the response and curl_getinfo:&lt;/P&gt;&lt;PRE&gt;string(0) ""
Array
(
    [url] =&amp;gt; https://api.dropbox.com/2/users/get_current_account
    [content_type] =&amp;gt; text/plain; charset=utf-8
    [http_code] =&amp;gt; 400
    [header_size] =&amp;gt; 394
    [request_size] =&amp;gt; 259
    [filetime] =&amp;gt; -1
    [ssl_verify_result] =&amp;gt; 0
    [redirect_count] =&amp;gt; 0
    [total_time] =&amp;gt; 0.273269
    [namelookup_time] =&amp;gt; 3.3E-5
    [connect_time] =&amp;gt; 0.004135
    [pretransfer_time] =&amp;gt; 0.017209
    [size_upload] =&amp;gt; 0
    [size_download] =&amp;gt; 0
    [speed_download] =&amp;gt; 0
    [speed_upload] =&amp;gt; 0
    [download_content_length] =&amp;gt; -1
    [upload_content_length] =&amp;gt; 0
    [starttransfer_time] =&amp;gt; 0.27322
    [redirect_time] =&amp;gt; 0
    [redirect_url] =&amp;gt; 
    [primary_ip] =&amp;gt; 162.125.66.7
    [certinfo] =&amp;gt; Array
        (
        )

    [primary_port] =&amp;gt; 443
    [local_ip] =&amp;gt; 46.38.241.53
    [local_port] =&amp;gt; 50110
)&lt;/PRE&gt;&lt;P&gt;Can someone help me pls?&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:11:22 GMT</pubDate>
    <dc:creator>Lotus</dc:creator>
    <dc:date>2019-05-29T09:11:22Z</dc:date>
    <item>
      <title>Empty response for /get_current_account</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Empty-response-for-get-current-account/m-p/288393#M17643</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;some years ago I used the dropbox Api v1 and now I try to switch to v2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I managed to get the authorization done but now I'm struggeling with the /get_current_account endpoint.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my php looks like that:&lt;/P&gt;&lt;PRE&gt;public static function dropboxAuthorize($token) {		
	$curl = curl_init();
	curl_setopt($curl, CURLOPT_VERBOSE, 1);
	curl_setopt_array($curl, array(
	  CURLOPT_URL =&amp;gt; "https://api.dropbox.com/2/users/get_current_account",
	  CURLOPT_RETURNTRANSFER =&amp;gt; true,
	  CURLOPT_ENCODING =&amp;gt; "",
	  CURLOPT_NOBODY =&amp;gt; true,
	  CURLOPT_MAXREDIRS =&amp;gt; 10,
	  CURLOPT_TIMEOUT =&amp;gt; 50,
	  CURLOPT_HTTP_VERSION =&amp;gt; CURL_HTTP_VERSION_1_1,
	  CURLOPT_CUSTOMREQUEST =&amp;gt; "POST",
	  CURLOPT_HTTPHEADER =&amp;gt; array(
		"authorization: Bearer " . $token,
		"cache-control: no-cache",
		"content-type: application/json"
	  ),
	));

	$response = curl_exec($curl);
}&lt;/PRE&gt;&lt;P&gt;The response is empty! Not false or anything else. I get no erros and don't know what's wrong.&lt;/P&gt;&lt;P&gt;If I send the request via Postman I get the correct response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my var_dump of the response and curl_getinfo:&lt;/P&gt;&lt;PRE&gt;string(0) ""
Array
(
    [url] =&amp;gt; https://api.dropbox.com/2/users/get_current_account
    [content_type] =&amp;gt; text/plain; charset=utf-8
    [http_code] =&amp;gt; 400
    [header_size] =&amp;gt; 394
    [request_size] =&amp;gt; 259
    [filetime] =&amp;gt; -1
    [ssl_verify_result] =&amp;gt; 0
    [redirect_count] =&amp;gt; 0
    [total_time] =&amp;gt; 0.273269
    [namelookup_time] =&amp;gt; 3.3E-5
    [connect_time] =&amp;gt; 0.004135
    [pretransfer_time] =&amp;gt; 0.017209
    [size_upload] =&amp;gt; 0
    [size_download] =&amp;gt; 0
    [speed_download] =&amp;gt; 0
    [speed_upload] =&amp;gt; 0
    [download_content_length] =&amp;gt; -1
    [upload_content_length] =&amp;gt; 0
    [starttransfer_time] =&amp;gt; 0.27322
    [redirect_time] =&amp;gt; 0
    [redirect_url] =&amp;gt; 
    [primary_ip] =&amp;gt; 162.125.66.7
    [certinfo] =&amp;gt; Array
        (
        )

    [primary_port] =&amp;gt; 443
    [local_ip] =&amp;gt; 46.38.241.53
    [local_port] =&amp;gt; 50110
)&lt;/PRE&gt;&lt;P&gt;Can someone help me pls?&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:11:22 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Empty-response-for-get-current-account/m-p/288393#M17643</guid>
      <dc:creator>Lotus</dc:creator>
      <dc:date>2019-05-29T09:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: Empty response for /get_current_account</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Empty-response-for-get-current-account/m-p/288399#M17645</link>
      <description>I see that you're getting a response with a 400 status code, which means that the call failed. The response body should contain a more useful error message, so you should print it out. &lt;BR /&gt;&lt;BR /&gt;You're setting 'CURLOPT_NOBODY =&amp;gt; true' though, so curl won't return the body. Disable that to retrieve the body.</description>
      <pubDate>Wed, 01 Aug 2018 18:07:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Empty-response-for-get-current-account/m-p/288399#M17645</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-08-01T18:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: Empty response for /get_current_account</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Empty-response-for-get-current-account/m-p/288482#M17648</link>
      <description>&lt;P&gt;Thanks for your response!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought this option would mean that I send no request body to the server and not that I don't get one...&lt;/P&gt;&lt;P&gt;If I disable this option I get the following error:&lt;/P&gt;&lt;PRE&gt;string(103) "Error in call to API function "users/get_current_account": request body: could not decode input as JSON"&lt;/PRE&gt;&lt;P&gt;I tried to google that problem but couldn't find any helpful information.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you help me again?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 04:39:09 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Empty-response-for-get-current-account/m-p/288482#M17648</guid>
      <dc:creator>Lotus</dc:creator>
      <dc:date>2018-08-02T04:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Empty response for /get_current_account</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Empty-response-for-get-current-account/m-p/288589#M17661</link>
      <description>&lt;P&gt;That error is indicating that the request body couldn't be parsed as JSON.&amp;nbsp;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#users-get_current_account" target="_blank"&gt;This endpoint&lt;/A&gt; doesn't have any required parameters, so you can just specify:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;CURLOPT_POSTFIELDS =&amp;gt; "null",&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 16:29:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Empty-response-for-get-current-account/m-p/288589#M17661</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-08-02T16:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Empty response for /get_current_account</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Empty-response-for-get-current-account/m-p/288806#M17689</link>
      <description>Thanks a lot! It worked.</description>
      <pubDate>Fri, 03 Aug 2018 15:44:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Empty-response-for-get-current-account/m-p/288806#M17689</guid>
      <dc:creator>Lotus</dc:creator>
      <dc:date>2018-08-03T15:44:14Z</dc:date>
    </item>
  </channel>
</rss>

