We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Junho S.
11 years agoNew member | Level 1
Use save_url api to move files from onedrive or google drive
Hi,
I am now testing /save_url api for moving my files in onedrive. However, only partial data is done to transfer when I trigger the api.
I, of course, already set the files in onedrive to be publicly shared and input the shared url at onedrive for the api call.
Please, help me this problem.
Thanks~
9 Replies
Replies have been turned off for this discussion
- Junho S.11 years agoNew member | Level 1
In addition, I want to move my files in onedrive to dropbox directly without intervening my mobile device.
- Greg-DB11 years ago
Dropbox Community Moderator
Can you share your code and whatever output/errors you get?
- Junho S.11 years agoNew member | Level 1
here is my code as below:
curl -X POST https://api.dropbox.com/1/save_url/auto/file_name -d url="http://1drv.ms/1GJwlwY" -H "Authorization: Bearer my_token"The url is the download link of the shared file in OneDrive and I already set it as publicly available to download.
Cheers~ - Greg-DB11 years ago
Dropbox Community Moderator
When I try to access that link directly in my browser to test it, I get the following error:
This item might not exist or is no longer available
This item might have been deleted, expired, or you might not have permission to view it. Contact the owner of this item for more information.If that's not the cause of the problem you're seeing, please post a working link we can try out.
- Junho S.11 years agoNew member | Level 1
please try this link, http://1drv.ms/1FSGzdE, again.
- Greg-DB11 years ago
Dropbox Community Moderator
Thanks! That link appears to work, and using it with the Dropbox API /save_url endpoint does successfully save a file to my account. Inspecting the file, however, shows that it actually just saves the HTML page. The file begins with:
<html>
<head>
<title>Microsoft OneDrive
...and so on.That makes sense though, as your link, e.g., when tested in a browser, does yield an HTML page, and not the .pdf file itself, which is displayed interactively in the browser on that HTML page.
If you want to save the actual .pdf file itself, you'll need a link that returns the actual PDF content directly. That's outside the scope of Dropbox API support of course though, so I recommend referring to the OneDrive documentation or support.
- Junho S.11 years agoNew member | Level 1
Thanks Greg. I understand what you said.
- Junho S.11 years agoNew member | Level 1
One more question, Greg.
Does Dropbox provide the api for directly downloadable link of the file?
- Greg-DB11 years ago
Dropbox Community Moderator
Yes, if you just need a temporary link for accessing file content, you can use /media:
https://www.dropbox.com/developers/core/docs#media
For longer-lived shareable links, you can use /shares:
https://www.dropbox.com/developers/core/docs#shares
Note that those links goes to a preview page by default, but you can modify their behavior, e.g., for direct file access, as shown here:
About Dropbox API Support & Feedback
Find help with the Dropbox API from 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!