Dropbox icon indicating copy to clipboard operation
Dropbox copied to clipboard

Forbidden error

Open adabie opened this issue 11 years ago • 4 comments

I'm getting a forbidden error when I run the example putFile. I can run accountInfo without any issue. I just switched over to use the database to store the tokens. I was able to write the files before the change but now I get the forbidden error. Here is the actual error dump:

Fatal error: Uncaught exception 'Dropbox\Exception' with message 'Forbidden' in E:\web\relaytra\EBARR\NewTest\Dropbox\OAuth\Consumer\Curl.php:153 Stack trace: #0 E:\web\relaytra\EBARR\NewTest\Dropbox\API.php(495): Dropbox\OAuth\Consumer\Curl->fetch('POST', 'https://api-con...', 'files/sandbox/', Array) #1 E:\web\relaytra\EBARR\NewTest\Dropbox\API.php(110): Dropbox\API->fetch('POST', 'https://api-con...', 'files/sandbox/', Array) #2 E:\web\relaytra\EBARR\NewTest\examples\putFile.php(19): Dropbox\API->putFile('C:\Windows\Temp...', 'api_upload_test...') #3 {main} thrown in E:\web\relaytra\EBARR\NewTest\Dropbox\OAuth\Consumer\Curl.php on line 153

Any idea what I have wrong?

Also should the userId match the one from the accountinfo? My userId is 1.

Thanks!

adabie avatar Apr 06 '13 17:04 adabie

Hi @adabie

Sorry for the delay in getting back to you. Are you still experiencing this problem? I've not seen it before so I'll need some time to look into it.

Regarding user ID: The ID passed to the storage handler should be your internal user ID (should match the ID used in your users table, for example). Hope this helps.

BenExile avatar Apr 15 '13 07:04 BenExile

Hi,

I found my issue. I needed to switch from using the 'sandbox' to using 'dropbox' for my access type. My app doesn't write to the app folder. It's working now.

Thanks!

adabie avatar Apr 15 '13 14:04 adabie

@adabie how to switch from sandbox to dropbox ? im also facing the same issue

sureshdsk avatar Jun 03 '13 15:06 sureshdsk

HI @sureshdsk

Either pass 'dropbox' as the second argument when instantiating the Dropbox\API object, or call Dropbox\API::setRoot(), passing 'dropbox' as the only argument.

BenExile avatar Jun 03 '13 16:06 BenExile