Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Shwetank S.
10 years agoNew member | Level 1
HTTP request to dropbox APIs
how do we make HTTP requests to dropbox APIs?
Greg-DB
Dropbox Community Moderator
10 years agoThe app authorization process is handled via OAuth 2. The documentation for the OAuth 2 page and endpoint can be found here:
https://www.dropbox.com/developers/documentation/http/documentation#oauth2-authorize
There's a blog post here that shows how to implement OAuth 2:
https://blogs.dropbox.com/developers/2013/07/using-oauth-2-0-with-the-core-api/
There's also an OAuth guide here that may be helpful:
https://www.dropbox.com/developers/reference/oauthguide
And here's a simple example of uploading a file (from text) in JavaScript using jQuery:
var data = new TextEncoder("utf-8").encode("Test");
$.ajax({
url: 'https://content.dropboxapi.com/2/files/upload',
type: 'post',
data: data,
processData: false,
contentType: 'application/octet-stream',
headers: {
"Authorization": "Bearer <ACCESS_TOKEN>",
"Dropbox-API-Arg": '{"path": "/test_upload.txt","mode": "add","autorename": true,"mute": false}'
},
success: function (data) {
console.log(data);
}
})
<ACCESS_TOKEN> should be replaced with the OAuth 2 access token.
And here's a simple example of getting the user's account information using jQuery:
jQuery.ajax({
url: 'https://api.dropboxapi.com/2/users/get_current_account',
type: 'POST',
headers: {
"Authorization": "Bearer <ACCESS_TOKEN>"
},
success: function (data) {
console.log(data);
},
error: function (error) {
console.log(error);
}
})
<ACCESS_TOKEN> should be replaced with the OAuth 2 access token.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!