We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
Li P.
10 years agoNew member | Level 1
Can I save a JSON stream object to Dropbox file with Dropbox Post Rest API ?
Hi,
I sent a request to salesforce , then get a JSON stream. Now I want to save the stream object into a Dropbox file by sending Post request in my code. Does Dropbox have relative Post res...
Li P.
10 years agoNew member | Level 1
Hi Greg,
Below is another issue:
I created a Dropbox API app, It includes APP key and APP secret now, and generated access token in my APP page. Then I use lib 'dbox' in the browser-client. Below is my JS:
var dboxclient = require('dbox');
var app = dboxclient.app({"app_key": "j4nrv1xhtjj3svq","app_secret":"<REDACTED>"});
var client = app.client("<REDACTED>");
module.exports = DBOX;
function DBOX() {
}
DBOX.prototype.getAccount = function() {
client.account(function(status, reply){
console.log(reply)
});
}
DBOX.prototype.Metadata = function() {
// available options...
var options = {
file_limit : 10000, // optional
//hash : ..., // optional
list : true, // optional
include_deleted : false, // optional
//rev : 7, // optional
credentials : false,
locale : "en", // optional
root : "sandbox" // optional
};
client.metadata("started.pdf", options, function(status, reply) {
console.log(reply);
});
}
DBOX.prototype.Putfile = function() {
client.put("hello.txt", "here is some text", function (status, reply) {
console.log(reply);
});
}
Then I call it in my another js like this:
var dbox = new DBOX();
dbox.getAccount();
//dbox.Putfile();
It failed with error message in the browser console:
POST https://api.dropbox.com/1/account/info request.js:117 Request.endmain.js:761 Request.endmain.js:345 (anonymous function)browser.js:19 drainQueue
localhost/:1 XMLHttpRequest cannot load https://api.dropbox.com/1/account/info. A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin 'http://localhost:3000' is therefore not allowed access.
main.js:422 Uncaught TypeError: Cannot read property 'set-cookie' of undefinedmain.js:422 (anonymous function)events.js:77 EventEmitter.emitrequest.js:61 (anonymous function)events.js:74 EventEmitter.emitresponse.js:92 Response.handlerequest.js:73 xhr.onreadystatechange
Do you any Ideas?
Thank you!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 12 months agoIf 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!