cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Trying to upload files to a folder shared from another account

Trying to upload files to a folder shared from another account

uberguppy
New member | Level 2
Go to solution

My case is this.  Our company will generates files that we pass off to another company for processing (printing, specifically).  These files are not really big, say less than 100M each, PDFs.  Up to now this pass-off process has been "manual": we generate the files with a script, then upload them to a folder shared from the 2nd company, in our Dropbox account.  The whole arrangement has been pretty informal, just personal use Dropbox accounts on our end.

 

We now want to automate the passing-off of the files.  I have been working on code to do this and it works, but not quite.  I started by creating an app for my account.  I scoped the app to a specific folder.  I can upload files via API call with the app credentials (token) no problem.  However, the files need to get dropped in the 2nd company's shared folder.  (1) I tried moving the shared folder into the app scoped folder, but that is not allowed.  (2) I then tried a different app, scoped to my entire Dropbox account (not scoped to the folder), so I could put files into the shared folder; but when I did this I got a "missing scope" error, with the scope "files.content.write" required.  However, for the app I did turn this permission on.  I imagine it has to do with my app somehow not having permission to the 2nd company's shared folder, although I don't know.

 

So I'm not sure how to do this.  I recognize that I am possibly doing it all wrong.  It occurred to me that the 2nd company might need to be the one to create an app in their Dropbox and give us the app credentials or whatnot, but as I said, this is pretty informal and I'd like to keep this 2nd company's setup in their account for our needs to an absolute minimum.  Hopefully I just missed something in the above that will get this to work for us?

 

Thanks in advance for help.

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

As you found, app folders are incompatible with shared folders, meaning you can't share an app folder, put a shared folder inside an app folder or put an app folder in a shared folder. Instead, if you need to use the API with shared folders, you'll need to use "full Dropbox" permission, as opposed to the app folder permission. You can find more information about app permissions here.

 

Using full Dropbox access, you certainly should be able to programmatically access a shared folder in your connected account. A 'missing_scope' error indicates though just indicates that while the app is permitted to use that scope, the particular access token you're using to make the API call does not have that scope granted. Be aware that just adding a scope to your app via the App Console does not retroactively grant that scope to existing access tokens.

 

That being the case, to make any API calls that require that scope, you'll need to get a new access token with that scope.

View solution in original post

1 Reply 1

Greg-DB
Dropbox Staff
Go to solution

As you found, app folders are incompatible with shared folders, meaning you can't share an app folder, put a shared folder inside an app folder or put an app folder in a shared folder. Instead, if you need to use the API with shared folders, you'll need to use "full Dropbox" permission, as opposed to the app folder permission. You can find more information about app permissions here.

 

Using full Dropbox access, you certainly should be able to programmatically access a shared folder in your connected account. A 'missing_scope' error indicates though just indicates that while the app is permitted to use that scope, the particular access token you're using to make the API call does not have that scope granted. Be aware that just adding a scope to your app via the App Console does not retroactively grant that scope to existing access tokens.

 

That being the case, to make any API calls that require that scope, you'll need to get a new access token with that scope.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?