Showing results for 
Search instead for 
Did you mean: 
Update: Find information on Dropbox support during COVID-19 here
Showing results for 
Search instead for 
Did you mean: 

Problem calling API from PHP

New member | Level 2
New member | Level 2

I make the authentication step and got the accesstoken as well.

now I want to start an API call so I wrote the below code:

# Include the Dropbox SDK libraries
require_once "dropbox-sdk/Dropbox/autoload.php";
use \Dropbox as dbx;
echo "Step 1 <br>";
$dbxClient = new dbx\Client($accessToken, "updashboard-test");
echo "Step 2 <br>".var_dump($dbxClient);
$accountInfo = $dbxClient->getAccountInfo();
echo "Step 3 <br>";


it passed Step 1 and 2 but stoped on step 3 and notting desplayed. plese see the below my screen shot:


Step 1 
object(Dropbox\Client)#2 (6) { ["accessToken":"Dropbox\Client":private]=> string(64) "XXXXX" ["clientIdentifier":"Dropbox\Client":private]=> string(16) "updashboard-test" ["userLocale":"Dropbox\Client":private]=> NULL ["apiHost":"Dropbox\Client":private]=> string(15) "" ["contentHost":"Dropbox\Client":private]=> string(23) "" ["host"]=> object(Dropbox\Host)#3 (3) { ["api":"Dropbox\Host":private]=> string(15) "" ["content":"Dropbox\Host":private]=> string(23) "" ["web":"Dropbox\Host":private]=> string(15) "" } }

Step 2 


I canged AccessToken to XXXX on the above codes.

please let me know why it is like this.

1 Reply 1

Re: Problem calling API from PHP

The Dropbox PHP you're using here uses API v1, which is retired, so it will no longer work:

You'll need to migrate to API v2. We don't have an official PHP SDK for Dropbox API v2, but you can use a third party library:

Or, you can call the HTTPS endpoints themselves:

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?