You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

tiwas's avatar
tiwas
New member | Level 2
4 years ago

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 point me in the direction of information on how to do this without reading the whole API reference? 😉

 

Thanks!

    • tiwas's avatar
      tiwas
      New 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 & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,888 PostsLatest Activity: 23 hours ago
326 Following

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 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!