It's my first time on these forums, and I'm having a minor issue with Dropbox. I was wondering if someone could help. Someone alluded to a solution on the forums about a year ago here:
https://community.zapier.com/dropbox-q-a-69/create-duplicates-of-existing-dropbox-folders-8731?postid=41639#post41639
In short, I'm trying to copy over a folder structure from one place to another within Dropbox. There seems to be a solution by linking a Webhook to the Dropbox API, and I'm a bit out of my depth when setting up webhooks and talking to an API.
Any chance you can help with step-by-step instructions for setting this up?
How do I copy a whole Dropbox structure from one place to another
Best answer by sillywonkaBest answer by sillywonka
Ok, so I got this to work! Yay!
For others looking to do this who aren’t as code-savvy. I mean, that’s why we’re here, no?:
On the Zapier side:
I’m using a Webhook Zap with a POST Event, and the configuration is pasted at the end.
You copy over the URL from the Dropbox API documentation. Note that the “from_path” and “to_path” data field inputs have to be added with the plus box, and the “from_path” must be accessible in Dropbox through Zapier already (i.e., if you can’t find the folder using a normal Dropbox Zap, this won’t work).
You can point to a file or a folder. If it’s a folder, the whole folder structure will come through with the files inside that folder. Also, the “to_path” needs to end at the name of the folder you want to create; for example, to_path would be set to “/to/my/path/new_name,” where the new name is the name of the folder you want the new contents to be dropped into.
Some things to note:
Copying the paths from, say, a “windows explorer bar” needs to be reformatted to forward slashes “/” from backslashes “\” so:
\to\my\path\folder_to_copy
Becomes
/to/my/path/folder_to_copy
On the Dropbox side:
I’ve had to create a Dropbox App. I’m not sure all users can create apps. We have a paid business account.
https://www.dropbox.com/developers/
In the App Console, we’ve created an app and granted it OAuth 2.0 access, setting it to “Allow Public Clients” in the “Settings” tab. Then in the “Permissions” tab, we’ve given the app “Files and folders” read and write access and checked off the “openid” checkbox. Note that this configuration means you won’t be able to give the app permission for “Team Scopes.” Not sure if that matters to anyone else. It seemed to be necessary that this box be checked for this to work. (Maybe?)
Finally, once that’s done and you’re logged in, you can click on the Dropbox API documentation that Troy posted and click on the “<get access token>” within the example. It’s a bit hard to see, but it's a blue link, and if you’re logged in, it will generate the access token for you. Copy that long ass string, including the “Bearer ” (with the space) at the front.
https://www.dropbox.com/developers/documentation/http/documentation#files-copy
Back in the Zap
In the Headers section, create a new Header and label it “Authorization” (no quotes), and paste the copied value into the value side box on the right.
Here are other things to note here before hitting the test button.
Payload Type: JSON.
Wrap Request In Array: set this to No since Dropbox is not expecting a list.
File: None are needed for this.
Unflatten: Set this to Yes.
Basic Auth: Leave this field blank, as this will cause the webhook to try to log in with standard credentials, but the post requires an authentication header. Having both gives an error.
Lastly, fire up a folder window and navigate to the folder where the stuff will be copied, and hit the test button. You should see it pop up after a few seconds. Adjust the paths if it's not what you expected.

Good luck, everyone! Happy Zapping!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.