We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Crypto C.
11 years agoNew member | Level 1
OAuth 2.0 - IOS API V 2.0
Hello !
I use the the version API dropbox 1.0 for my app IOS, the new 2.0 is only swift and i can not use it because my app use only object-c.
So now i use API 1.0 for generate autentication DBS...
SGS E.
11 years agoNew member | Level 1
Hi,
I'm sorry but i still cant do it.
Now what i have is DBSession restClien or something like that.Is there anyway to get accesssToken v2 from resclient ?
Could you please give some sample code in your project ?
here is my code but it doesnt work well
MPOAuthCredentialConcreteStore* credential = [[DBSession sharedSession] credentialStoreForUserId:[info userId]];
AFHTTPSessionManager* manager = [[AFHTTPSessionManager alloc] initWithBaseURL:[NSURL URLWithString:BASE_URL]];
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
manager.requestSerializer = [AFHTTPRequestSerializer serializer];
[manager.requestSerializer setValue:@"OAuth" forHTTPHeaderField:@"Authorization"];
[manager.requestSerializer setValue:@"1.0" forHTTPHeaderField:@"oauth_version"];
[manager.requestSerializer setValue:@"PLAINTEXT" forHTTPHeaderField:@"oauth_signature_method"];
[manager.requestSerializer setValue:APP_KEY_DB forHTTPHeaderField:@"oauth_consumer_key"];
[manager.requestSerializer setValue:credential.accessToken forHTTPHeaderField:@"oauth_token"];
[manager.requestSerializer setValue:[NSString stringWithFormat:@"%@&%@",credential.requestTokenSecret,credential.accessTokenSecret] forHTTPHeaderField:@"oauth_signature"];
[manager POST:@"https://api.dropboxapi.com/1/oauth2/token_from_oauth1" parameters:@{} success:^(NSURLSessionDataTask *task, id responseObject) {
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
//It show error
Code=-1011 "Request failed: bad request (400)"
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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!