Hi, I'm trying to upload files from my website to dropbox and it was working, but i received an error message saying the Access Token Expired. I research a little bit, and read that now dropbox uses "refresh token". I'm trying to find an example or tutorial in order to change the code im using to make it work with refresh token, but I can't find anything. My question is: What do I need to change in this code to make it work with NON EXPIRE TOKEN.
Thanks.
<?php
$fp = fopen($path, 'rb');
$size = filesize($path);
$cheaders = array('Authorization: Bearer <ACCESS TOKEN>',
'Content-Type: application/octet-stream',
'Dropbox-API-Arg: {"path":"/test/'.$path.'", "mode":"add"}');
curl_setopt($ch, CURLOPT_HTTPHEADER, $cheaders);
curl_setopt($ch, CURLOPT_PUT, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_INFILE, $fp);
curl_setopt($ch, CURLOPT_INFILESIZE, $size);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
echo $response;
curl_close($ch);
fclose($fp);
?>