Hi,
some years ago I used the dropbox Api v1 and now I try to switch to v2.
I managed to get the authorization done but now I'm struggeling with the /get_current_account endpoint.
my php looks like that:
public static function dropboxAuthorize($token) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_VERBOSE, 1);
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.dropbox.com/2/users/get_current_account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_NOBODY => true,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 50,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer " . $token,
"cache-control: no-cache",
"content-type: application/json"
),
));
$response = curl_exec($curl);
}The response is empty! Not false or anything else. I get no erros and don't know what's wrong.
If I send the request via Postman I get the correct response.
This is my var_dump of the response and curl_getinfo:
string(0) ""
Array
(
[url] => https://api.dropbox.com/2/users/get_current_account
[content_type] => text/plain; charset=utf-8
[http_code] => 400
[header_size] => 394
[request_size] => 259
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.273269
[namelookup_time] => 3.3E-5
[connect_time] => 0.004135
[pretransfer_time] => 0.017209
[size_upload] => 0
[size_download] => 0
[speed_download] => 0
[speed_upload] => 0
[download_content_length] => -1
[upload_content_length] => 0
[starttransfer_time] => 0.27322
[redirect_time] => 0
[redirect_url] =>
[primary_ip] => 162.125.66.7
[certinfo] => Array
(
)
[primary_port] => 443
[local_ip] => 46.38.241.53
[local_port] => 50110
)
Can someone help me pls?