We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
gauravsc
8 years agoExplorer | Level 3
How to transfer files from one dropbox account to another dropbox account programmatically?
I am lookingfor a way to transfer files from one account to another dropbox account. I would like to achieve this programmatically (.Net/ Javascript). I tried to look up in forum/stack overflow and d...
- 8 years ago
It sounds like you're using two different apps; one for the source account, and one for the destination account. In order to use a copy reference between two accounts, they'll both need to be connected to the same app.
So, you should create an app on just one account, and then get an access token for that same app for each of the different accounts.
For the account that owns the app, you can do so easily by using the "Generate" button on the app's page on the App Console.
For the other account though, you'll need to use the OAuth app authorization flow:
https://www.dropbox.com/developers/reference/oauth-guide
https://www.dropbox.com/developers/documentation/http/documentation#authorization
gauravsc
8 years agoExplorer | Level 3
Hi Greg
Thank you very much for your reply. I have checked the documentation and it is very helpful. Now i am trying to simulate copy-paste as specified in above docs in postman. I am getting copy reference but when i try to save using the copy_reference-save, i get no permission error. What i am doing is:
1. Create app in source account, from which i need to copy the file.
2. Create access token from source account with full rights.
3. Repeat above steps for destination account.
4. Send post request to copy_reference-get with access token of source account. Here i get copy reference as response.
5. Send post request to copy_reference-save with access token of destination account. Here i get error as no_permission.
error - no_permission
As i understand, my "destination account app" needs access of source account also. How can i connect "destination account app" to source account.
Greg-DB
Dropbox Community Moderator
8 years agoIt sounds like you're using two different apps; one for the source account, and one for the destination account. In order to use a copy reference between two accounts, they'll both need to be connected to the same app.
So, you should create an app on just one account, and then get an access token for that same app for each of the different accounts.
For the account that owns the app, you can do so easily by using the "Generate" button on the app's page on the App Console.
For the other account though, you'll need to use the OAuth app authorization flow:
https://www.dropbox.com/developers/reference/oauth-guide
https://www.dropbox.com/developers/documentation/http/documentation#authorization
- gauravsc8 years agoExplorer | Level 3
Hi greg, thanks for the reply.
I am able to replicate copy/paste from postman. If anyone is looking for quick test, here are the steps.
1. Create app in source account, from which i need to copy the file.
2. Create access token from source account with full rights.
3. Send post request to copy_reference-get with access token of source account. Here i get copy reference as response.
4. Open https://www.dropbox.com/oauth2/authorize?response_type=token&client_id=<YOUR_APP_KEY>&redirect_uri=<Your redirect url or put any url here>
5. You will get prompt to login to dropbox, if not already logged in, and then you will be redirected to authorization page.
6. Once you click on allow, access token is generated and will be available from url returned.
7. This access token can be used in postman for copy_reference-save.
About Discuss Dropbox Developer & API
Make connections with other developers
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!