Tachun Lin
Tachun Lin

Reputation: 972

Dropbox Datastore API, how to show username?

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

Answers (1)

user94559
user94559

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

Related Questions