如何使用V2 Box iOS SDK获取创建者和上次修改日期

时间:2013-07-22 12:13:54

标签: iphone ios box-api

使用folderID获取文件夹项目时,我只在json响应字典中获取了5个项目。

{ etag = 4; id = 924199771; name = Philips; "sequence_id" = 4; type = folder; }

我需要Created By和Last Modified TimeStamp以及此响应。我正在使用Box V2 iOS SDK。需要帮助才能得到这个。

2 个答案:

答案 0 :(得分:3)

您可以指定您想要的字段:

BoxFoldersResourceManager *mgr = [BoxSDK sharedSDK].foldersManager;
BoxFoldersRequestBuilder *bldr = [[BoxFoldersRequestBuilder alloc] initWithQueryStringParameters:@{ @"fields" : @"name,type,id,size,modified_at,created_by" }];
[mgr folderItemsWithID:_folderId requestBuilder:bldr success:^(BoxCollection *collection) {
    // process results
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, NSDictionary *JSONDictionary) {
    // process error
}];

请务必列出创建BoxFoldersRequestBuilder时所需的任何字段。

答案 1 :(得分:2)

如果您添加字段参数并分隔您想要的逗号返回的项目,Box的响应将返回created_by和modifed_at。您还可以检索modifed_by。

http://developers.box.com/docs/#fields

?字段= CREATED_BY,modified_at