Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
var name = teamNum + "/" + matchNum + ".json";
var xhr = new XMLHttpRequest();
var filename = name;
var file = new File([JSON.stringify(dataset)], filename, { type: "text/json;charset=utf-8" });
xhr.open('POST', 'https://content.dropboxapi.com/2/files/upload');
xhr.setRequestHeader('Authorization', 'Bearer ' + <accessToken>);
xhr.setRequestHeader('Content-Type', 'application/octet-stream');
xhr.setRequestHeader('Dropbox-API-Arg', JSON.stringify({
path: '/Apps/BeachBlitz/' + file.name,
mode: 'overwrite',
autorename: false,
mute: false
}));
xhr.send(file);
The above code is giving me invalid access token but I definitely have a valid one. Does the above code look correct?
I just tried this code and it worked fine for me.
Can you clarify what you mean when you say you "definitely have a valid one"? How did you get the access token and how are you verifying that it's still active?
While Dropbox API access tokens don't expire by themselves, there a number of different ways that a Dropbox API access token can become invalid:
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!