-
Notifications
You must be signed in to change notification settings - Fork 83
Closed
Description
I'm converting some existing code to use your package because the old package locked us into Guzzle 6.x. So I already have an app key, app secret, and non-expiring access token.
According to your documentation, it looks like I should be able to supply the app key and app secret in an array to the constructor of Client, or I can provide the access token as a string. The access token as a string works to connect, but with the array of app key and app secret I get a Bad Request 400 error. My test code shown below:
public function testDropboxConnection()
{
require WILDFISH_CONFIGS_DIR . '.dropbox.php';
$dropboxConfig = getWassDropboxConfig('production');
try{
$client = new \Spatie\Dropbox\Client( $dropboxConfig['accessToken'] );
// For some reason this doesn't work...
/*$client = new \Spatie\Dropbox\Client([
$dropboxConfig['appKey'],
$dropboxConfig['appSecret']
]);*/
dump( $client->getAccountInfo() );
}
catch( \Spatie\Dropbox\Exceptions\BadRequest $e )
{
if( ENVIRONMENT == 'development' && TRUE )
dump( $e );
}
catch( \Exception $e )
{
if( ENVIRONMENT == 'development' && TRUE )
dump( $e );
}
}
Since I have it working with the access token, it's not critical for me that you fix this, but it did waste some of my time, so I thought I'd leave this here so you can take a look.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels