0

I'm using a Dropbox App with "Full Dropbox" access. I already have it working in one dropbox account and i'm setting it up for a client in a new account. They both seem to be the same type of account.

The problem is when i create folders via the Ruby SDK its putting the folders in the wrong place. I want it to go here:

*/Vendor OnBoarding/NEW FOLDER*

Instead its creating the folder structure here, where "John Doe" is my user name.

*/John Doe/Vendor OnBoarding/NEW FOLDER*

See screenshot below. The John Doe folder is in purple.

Dropbox folders

vendor_path = "/Vendor OnBoarding/Vendor Assets/NEW VENDOR"
dropbox_client = DropboxApi::Client.new(ENV['DROPBOX_ACCESS_TOKEN'])
dropbox_client.create_folder vendor_path
mdundas
  • 779
  • 1
  • 6
  • 11
  • Although I don't know Ruby, the requirements here on Stack Overflow is that if you have code that misbehaves, you should post a [mcve] that exhibits the problem you have. Without it, all anyone here can say is "Well, then you're probably doing something wrong". – Lasse V. Karlsen Jan 29 '20 at 13:46
  • Added the code to the post. I guess this is a question about Dropbox setup b/c this code works on a different dropbox account: – mdundas Jan 29 '20 at 14:20

1 Answers1

1

By default, when you make a Dropbox API call, it will operate in the connected user's "home folder".

In the case of a Dropbox Business account using the "team space" configuration, such as in the screenshot you shared, the "home" folder is that member's own named folder, which is the purple folder in your screenshot.

So, by default, you won't be uploading to that "Vendor OnBoarding" folder in the team space, but you can configure the Dropbox API call to do so, by using the 'Dropbox-API-Path-Root' header. You can find information on how to use that in the Dropbox Namespace Guide here:

https://www.dropbox.com/developers/reference/namespace-guide

Greg
  • 16,359
  • 2
  • 34
  • 44
  • Thank you. I was able to confirm this is the case. Unfortunately my SDK doesn't support connecting to Dropbox with a different namespace, so i'm forced to use the default home folder. – mdundas Feb 20 '20 at 15:10