which api should i use to get image stored in user's dropbox .
i tried using /download using php
curl -X POST https://content.dropboxapi.com/2/files/download \
--header "Authorization: Bearer " \
--header "Dropbox-API-Arg: {\"path\": \"/Homework/math/Prime_Numbers.txt\"}
$result=$processDB->getData($sql);
$api_url = 'https://content.dropboxapi.com/2/files/download'; //dropbox api url
$filename = $_FILES["file"]['tmp_name'];
$headers = array('Authorization: Bearer '. $result[0]['token'],
'Content-Type: application/octet-stream',
'Dropbox-API-Arg: '.
json_encode(
array(
"path"=> $value['path']
)
)
);
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo($response.'<br/>');
echo($http_code.'<br/>');
curl_close($ch);
this the code i using.
but response all unknow code. Am i using the correct api ? or any better way.