Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Alex_Shekunsky
8 years agoExplorer | Level 4
Get user's account info
Hi!
I need help.
How i can get linked user's dropbox account info (name/email) in Objective-c by API v2 ?
In v1 i did this by
[self.restClient loadAccountInfo];
in method:
- (void)restClient:(DBRestClient*)client loadedAccountInfo:(DBAccountInfo*)info
Thanks!
If you're using the API v2 Objective-C SDK, the equivalent method is getCurrentAccount:
Here's an example of how you would make an "RPC-style" request like that (for creating a folder in this case):
https://github.com/dropbox/dropbox-sdk-obj-c#rpc-style-request
Xcode should auto-complete most of the boilerplate code for you though.
3 Replies
Replies have been turned off for this discussion
- Greg-DB8 years ago
Dropbox Community Moderator
If you're using the API v2 Objective-C SDK, the equivalent method is getCurrentAccount:
Here's an example of how you would make an "RPC-style" request like that (for creating a folder in this case):
https://github.com/dropbox/dropbox-sdk-obj-c#rpc-style-request
Xcode should auto-complete most of the boilerplate code for you though.
- Alex_Shekunsky8 years agoExplorer | Level 4
Thank you very much!
- tomsax8 years agoNew member | Level 2
If you have a DBUserClient object (e.g. from [DBClientsManager authorizedClient]), you can get the info for that account with this call:
[[client.usersRoutes getCurrentAccount] setResponseBlock:^(DBUSERSFullAccount * _Nullable result, DBNilObject * _Nullable routeError, DBRequestError * _Nullable networkError) { if (networkError != nil) { NSLog(@"getCurrentAccount failed: network error"); } else if (routeError != nil) { NSLog(@"getCurrentAccount failed: route error"); } else { NSLog(@"got Dropbox account email: %@", result.email); } }];
About 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!