Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
tiwas
4 years agoNew member | Level 2
Need a little help getting started - want to write a simple text file
Hi,
Just found this out of necessity 😉 I need to write a small text file (predefined name, predefined content, no need to append) using either a rest client or http request.
Could someone po...
- 4 years ago
To upload a small file, you'd use the /2/files/upload endpoint:
https://www.dropbox.com/developers/documentation/http/documentation#files-upload
That's a link to the documentation for the HTTPS endpoints themselves, but we recommend using one of the official SDKs if possible:
https://www.dropbox.com/developers/documentation
Those have corresponding native methods for the HTTPS endpoints.
Greg-DB
Dropbox Community Moderator
4 years agoTo upload a small file, you'd use the /2/files/upload endpoint:
https://www.dropbox.com/developers/documentation/http/documentation#files-upload
That's a link to the documentation for the HTTPS endpoints themselves, but we recommend using one of the official SDKs if possible:
https://www.dropbox.com/developers/documentation
Those have corresponding native methods for the HTTPS endpoints.
tiwas
4 years agoNew member | Level 2
Thanks for that, it's pretty close to what I'm looking for. However, I have one more question.
Say I wanted to create a file in ~/compTest/test.txt, I would access the following path with the following payload?
https://content.dropboxapi.com/2/files/upload
{
"path": "/compTest/test.txt",
"mode": {
".tag": "overwrite",
"update": "a1c10ce0dd78"
},
"autorename": false,
"mute": false,
"strict_conflict": false
}Is there a way for me to specify the contents of the file? I would call this from a home automation system, so I don't have anywhere to store local files. The alternative would be to create a template in my dropbox and use the copy_v2 to copy this to the location I need it. It would be a workaround, but not very neat 😉
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!