Set the oAuth-secret
public setOAuthTokenSecret ( string $secret ) | ||
$secret | string | The secret to use. |
/** * Tests Dropbox->oAuthRequestToken() */ public function testOAuthRequestToken() { $this->dropbox->setOAuthToken(''); $this->dropbox->setOAuthTokenSecret(''); $response = $this->dropbox->oAuthRequestToken(); $this->assertArrayHasKey('oauth_token_secret', $response); $this->assertArrayHasKey('oauth_token', $response); }
use TijsVerkoyen\Dropbox\Dropbox; // create instance $dropbox = new Dropbox(APPLICATION_KEY, APPLICATION_SECRET); // The code below will do the oAuth-dance //if (!isset($_GET['authorize'])) { // $response = $dropbox->oAuthRequestToken(); // $_SESSION['oauth_token_secret'] = $response['oauth_token_secret']; // $dropbox->oAuthAuthorize($response['oauth_token'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] .'?authorize=true'); //} else { // $dropbox->setOAuthTokenSecret($_SESSION['oauth_token_secret']); // $response = $dropbox->oAuthAccessToken($_GET['oauth_token']); //} //var_dump($response); //exit; $dropbox->setOAuthToken(TOKEN); $dropbox->setOAuthTokenSecret(TOKEN_SECRET); try { // $response = $dropbox->accountInfo(); // // $response = $dropbox->filesGet(BASE_PATH .'hàh@, $.txt'); // $response = $dropbox->filesPost(BASE_PATH .'with spaces/', realpath(dirname(__FILE__)) . '/with spaces.txt', true); // // $response = $dropbox->metadata(BASE_PATH .'met spaties'); // $response = $dropbox->delta(); // $response = $dropbox->revisions(BASE_PATH .'hàh@, $.txt'); // $response = $dropbox->restore(BASE_PATH .'hàh@, $.txt', '368c7df600088e34'); // $response = $dropbox->search(BASE_PATH, 'txt'); // $response = $dropbox->shares(BASE_PATH); // $response = $dropbox->media(BASE_PATH .'hàh@, $.txt'); // $response = $dropbox->copyRef(BASE_PATH .'hàh@, $.txt'); // $response = $dropbox->thumbnails(BASE_PATH .'image.png');