We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
derickbarthelot
10 years agoNew member | Level 2
Uploading localhost mysql.sql file uploading problems
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");
1 Reply
- Steve M.10 years ago
Dropbox Staff
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.)
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
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!