Izbornik Zatvoriti

DropBox Access Token Generator for PHP

Skraćena veza: https://pedja.supurovic.net/veza/7971

Using Dropbox API is quite simple and easy. Procedure to get Access Token is also simple. However, each time I set up new application I have to go through the same procedure.

To help me out, I wrote very simple PHP script that simplifies process even more. It follows three stages of generating process in unified way, simplified to few click of mouse.

Stage1: Go to Dropbox site and create Dropbox Platform app (link is provided). You will get Access key and Access Secret. Copy that info to form and submit.

DropBox Access Token Generator - Stage 1
DropBox Access Token Generator – Stage 1

Stage2: open provided link to get Authorization Code. External page belongs to DropBox and basically just ask you to Allow usage of application. Click Allow and You will get Authorization Code.

Copy that code into provided edit box and submit again.

DropBox Access Token Generator - Stage 2
DropBox Access Token Generator – Stage 2

Stage3: Access Token will be generated for You. If error occurs just repeat Stage 2 to get another Authorization Code.

DropBox Access Token Generator - Stage 3
DropBox Access Token Generator – Stage 3

How to run DropBox Access Token Generator

DropBox Access Token Generator is not service, and I would not advise you to use any third party service as that would allow them to collect authentication data, which is something you would not like to happen.

DropBox Access Token Generator is actually very simple PHP script you can get from this page, save it as .PHP file and run on your own.

Pay attention that you have to install DropBox SDK by yourself and to set proper path to installed SDK.

Here is code download: get_access_key_token.php.txt (1183 downloads)

How to use Access Token

That is very simple. Generator provided three information: Access Key, Access Secret and Access Token. That is all You need. Example how to use them to get DropBox account info follows:


# Include the Dropbox SDK libraries
require_once "dropbox/autoload.php";
use \Dropbox as dbx;

$accessKey = 'htrcodosbx05sci';
$accessSecret = '8ghjszs28iecviu';
$accessToken = 

$appInfo = new dbx\AppInfo($accessKey, $accessSecret);
$webAuth = new dbx\WebAuthNoRedirect($appInfo, 

$dbxClient = new dbx\Client($accessToken, "PHP-Example/1.0");
$accountInfo = $dbxClient->getAccountInfo();

echo "accountInfo:";


You can use this for any other DropBox API call.

Important note: Access Key, Access Secret and Access Token used in this article are invalid. You have to create your own.

Ostavite odgovor

Vaša adresa e-pošte neće biti objavljena. Neophodna polja su označena *

Popunite izraz tako da bude tačan: *

Ovo veb mesto koristi Akismet kako bi smanjilo nepoželjne. Saznajte kako se vaši komentari obrađuju.