Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I have an problem with Dropbox api. I successfully installed and checked PHP all are ok. but every time connection asking the access token. I need to upload without any questions ask dirrectly upload file and download if needs.
Every time i need to follow these steps to get upload the file...... copy the token and past into $authCode.
$authorizeUrl = $webAuth->start();
echo "1. Go to: " . $authorizeUrl . "<br>";
echo "2. Click \"Allow\" (you might have to log in first).<br>";
echo "3. Copy the authorization code and insert it into authCode.<br>";
$authCode = trim('A23fdddsefsersfSFDSFd1BhBaikCob6bFDxkNSU');
list($accessToken, $dropboxUserId) = $webAuth->finish($authCode);
echo "Access Token: " . $accessToken . "<br>";
$dbxClient = new dbx\Client($accessToken, "PHP-Example/1.0");
You only need to obtain the access token once.
It looks like your code echos the access token, so just copy that (or get a token by clicking the "generate token" button on the app console) and then change your code to just this:
$accessToken = "<the token you obtained>"; $dbxClient = new dbx\Client($accessToken, "PHP-Example/1.0");
(Everything else in the code snippet you shared can be deleted or commented out, since you don't need to do it once you already have an access token.)
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!