Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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.
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.
Thank you very much!
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); } }];
Hi there!
If you need more help you can view your support options (expected response time for a 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!