1

Also it is preferably no to start a web-browser for user logging-in. For instance, the ES File Manager shows this form within its own fragment.

I need my application to be very small, while most of the libraries are of a few megabytes.

Carlos
  • 349
  • 1
  • 3
  • 17

2 Answers2

4

You can definitely access the API without a library, but all authentication requires OAuth (which requires opening a browser). All calls to the Core API are just HTTP with the header Authorization: Bearer <token>, so any HTTP library will do. For example, this curl command will write a file called hello.txt:

curl -X PUT https://api-content.dropbox.com/1/files_put/auto/hello.txt?overwrite=false \
   -H 'Authorization: Bearer <YOUR_TOKEN>' \
   -H 'Content-Type: text/plain' \
   -d 'Hello, World!'

See my blog posts about how to do call the Core API from the command-line with curl and how to do it from a variety of languages without using an OAuth or Dropbox library.

user94559
  • 59,196
  • 6
  • 103
  • 103
0

Yes, but Dropbox OAuth steps require signing in via the HTML representation. Source.

Note: This is the only step that requires an endpoint on www.dropbox.com. All other API requests are done via api.dropbox.com or api-content.dropbox.com.

After the OAuth process, you will receive the token and the secret. With these, you can make calls to the REST API using HTTP requests.

Here is an SO question and a nice answer discussing the Dropbox authentication with JavaScript (though using a library) :Transfer files to dropbox from node js without browser based oauth authentication

Community
  • 1
  • 1
supertopi
  • 3,469
  • 26
  • 38