Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I am wanting to create a BASH script in Linux to use when I need to load media files to a Dropbox request link that a group of mine uses for collaboration. How would I do this with curl? The link is in the form of https://www.dropbox.com/request/[REDACTED]. The web interface requests a NAME and an EMAIL ADDRESS when I hit upload. Can I just parse that in with the API? Is this a feasible task to accomplish? I am usually in a terminal shell and I could save myself time by just running a script to upload the file without having to jump into a browser.
something like this:
$> ./mydbupload.sh mycoolvideo.mp4
I would then edit my script to pass the my argument (ie. mycoolvideo.mp4) into a curl command.
Please advise.
Thanks!
@Rockymtns99 wrote:I am wanting to create a BASH script ... to load media files to a Dropbox request link ... How would I do this with curl? ...
Hi @Rockymtns99,
I don't think it's possible in such a way. If this was possible, that would be a throughput way for something like spam. 🙂
@Rockymtns99 wrote:... Can I just parse that in with the API? Is this a feasible task to accomplish? I am usually in a terminal shell and I could save myself time by just running a script to upload the file without having to jump into a browser. ...
Good questions and good idea! 😉
Unfortunately, there isn't a bash SDK. You can create something without SDK by using direct calls to curl, actually. Following API documentation, the simplest way is to create, by hand, a refresh token and save it in some configuration file. Next in your script you can read the refresh token, saved before, and using /oauth2/token call receive access token. Using the access token you can call all other API calls. It expires relatively soon, stays valid more than enough. Using /upload call smaller files could be uploaded directly. For bigger files (more than 150MB) you should gonna create upload session using /upload_session/start call and following calls.
For more sophisticated script, you can create a pseudo server using netcat to perform OAuth flow in addition to curl usage. 👌 "bash" is powerful enough to parse the query containing code/token/etc.
Hope this gives idea.
Dropbox unfortunately doesn't offer a way to programmatically upload to file requests like this, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
@Rockymtns99 wrote:I am wanting to create a BASH script ... to load media files to a Dropbox request link ... How would I do this with curl? ...
Hi @Rockymtns99,
I don't think it's possible in such a way. If this was possible, that would be a throughput way for something like spam. 🙂
@Rockymtns99 wrote:... Can I just parse that in with the API? Is this a feasible task to accomplish? I am usually in a terminal shell and I could save myself time by just running a script to upload the file without having to jump into a browser. ...
Good questions and good idea! 😉
Unfortunately, there isn't a bash SDK. You can create something without SDK by using direct calls to curl, actually. Following API documentation, the simplest way is to create, by hand, a refresh token and save it in some configuration file. Next in your script you can read the refresh token, saved before, and using /oauth2/token call receive access token. Using the access token you can call all other API calls. It expires relatively soon, stays valid more than enough. Using /upload call smaller files could be uploaded directly. For bigger files (more than 150MB) you should gonna create upload session using /upload_session/start call and following calls.
For more sophisticated script, you can create a pseudo server using netcat to perform OAuth flow in addition to curl usage. 👌 "bash" is powerful enough to parse the query containing code/token/etc.
Hope this gives idea.
Thanks. That makes sense. I was hoping that there would be an easy way to call a curl command from a script to do quick uploads to the request link but, it sounds like it isn't as simple as I thought.
This would be very useful!
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
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!