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...
Crypto C.
11 years agoNew member | Level 1
ok, thanks Gregory, another question if possible, i have problem with parameters for API v2, for example :
NSString *urlWithParams = @"https://api.dropboxapi.com/2/sharing/get_shared_links";
NSURL *url = [NSURL URLWithString:urlWithParams];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
[request setHTTPMethod:@"POST"];
[request addValue:[appDelegate apiAuthorizationHeader] forHTTPHeaderField:@"Authorization"];
NSDictionary *parameters = @{@"path": @"};
NSMutableString *parameterString = [NSMutableString string];
for (NSString *key in [parameters allKeys]) {
if ([parameterString length]) {
[parameterString appendString:@"&"];
}
[parameterString appendFormat:@"%@=%@", key, parameters[key]];
}
if (parameterString) [request setHTTPBody:[parameterString dataUsingEncoding:NSUTF8StringEncoding]];
NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data,
...
the problem is :
NSDictionary *parameters = @{@"path": @"};
NSMutableString *parameterString = [NSMutableString string];
for (NSString *key in [parameters allKeys]) {
if ([parameterString length]) {
[parameterString appendString:@"&"];
}
[parameterString appendFormat:@"%@=%@", key, parameters[key]];
}
if (parameterString) [request setHTTPBody:[parameterString dataUsingEncoding:NSUTF8StringEncoding]];
the format is incorrect ... where is the problem ??
thanks
m.
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!