Skip to content
This repository has been archived by the owner on Apr 18, 2019. It is now read-only.

Forbidden error #81

Open
adabie opened this issue Apr 6, 2013 · 4 comments
Open

Forbidden error #81

adabie opened this issue Apr 6, 2013 · 4 comments

Comments

@adabie
Copy link

adabie commented Apr 6, 2013

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!

@BenExile
Copy link
Owner

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.

@adabie
Copy link
Author

adabie commented Apr 15, 2013

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!

@sureshdsk
Copy link

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

@BenExile
Copy link
Owner

BenExile commented Jun 3, 2013

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants