Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

Andy's avatar
Andy
Icon for Super User alumni rankSuper User alumni
9 years ago

How do I work with Client.AccountInfo?

I'm looking to check a user's email and verification status through Client.AccountInfo. I currently use a 3rd party JavaScript Core SDK, but it's syntactically the same as the Datastore JS API, at least the Common section of these docs. Anyway, I currently have a var client as a new Dropbox.Client() with the public key passed in, and a client.authenticate() to go with it. The docs are either worded weirdly, or I'm missing something, but like I said, this SDK is syntactically the same as the Common part of the linked Datastore API. client.AccountInfo.email didn't seem to work, so how would I go about doing this?

2 Replies

Replies have been turned off for this discussion
  • Steve M.'s avatar
    Steve M.
    Icon for Dropbox Staff rankDropbox Staff
    9 years ago

    Are you by chance using https://github.com/dropbox/dropbox-js? (In general, it would probably help if you told people what library you're actually using.)

    Assuming you are, AccountInfo is a class. You'll need an instance of that class.

    I think you're looking for code like this (completely untested):

    client.getAccountInfo(function (err, accountInfo) {
        if (err) {
            console.log("ERROR: " + err);
        }
        else {
            console.log("Email: " + accountInfo.email);
    }
    });
  • Andy's avatar
    Andy
    Icon for Super User alumni rankSuper User alumni
    9 years ago

    Yup, that's the library. Totally forgot to mention that in my post. Sorry about that.

    I completely missed the .getAccountInfo() in either documentation. That seems to work perfectly!

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

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!