iOS dropbox sdk / core api - 未经授权列出public 文件夹内容

iOS dropbox sdk / core api - listing public folder contents without authorization

我已经尝试查看 Whosebug 和 api 文档,但找不到与此特定问题相关的任何信息。

我想做的是获取特定保管箱帐户的 public 文件夹内容(例如 api 的 /metadata 功能),而不需要 authorize/link 到保管箱。 我知道“/metadata/link”允许您在未经用户授权的情况下获取特定 link 的元数据,但我找不到获取常规元数据和文件列表的方法...

实际上它甚至不需要是 public 文件夹(正如我最近读到的那样,Dropbox 不鼓励开发人员依赖 public 文件夹来开发应用程序),它也可以通过其共享 link 或任何类似的方式成为常规文件夹...

我正在使用 api v1(但如果 v1 无法做到这一点,可以考虑更改为 v2),尽管我什至不确定这是否完全可行。

谢谢!

为了将来参考,如果有人也需要这个,我是这样做的:

NSString *parameters = [NSString stringWithFormat:@"?link=%@&client_id=%@&client_secret=%@",fileUrl, appKey, appSecret];
NSString *sharedPath = [NSString stringWithFormat:@"%@/%@",@"https://api.dropbox.com/1/metadata/link", parameters];
NSURL *url = [NSURL URLWithString:sharedPath];

NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url
                                                          cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData
                                                      timeoutInterval:10];
theRequest.timeoutInterval = 5.0;
theRequest.HTTPMethod = @"POST";

NSData * resData = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:nil error:nil];

使用NSJSONSerialization解析resData,json字段参考api文档,仅此而已。

为了简单起见,我在这里使用了同步请求,但使用异步连接委托也可以轻松完成。