Reputation: 972
I'm trying the Dropbox's Datastore API(JavaScript), but I don't know how to get username. I've tried something like this:
var account = new Dropbox.AccountInfo();
console.log('getAInfo' + account.getAccountInfo());
and I got this message in my console: "Uncaught TypeError: Cannot read property 'display_name' of undefined".
any idea?
Upvotes: 0
Views: 305
Reputation: 60143
Presumably you have a Dropbox.Client
object. To fetch the account info, do this:
client.getAccountInfo(function (error, info) {
console.log('Name: ' + info.name);
});
Upvotes: 1