简体   繁体   中英

How to get Created By and Last Modified Date using V2 Box iOS SDK

On fetching folder items using a folderID, i'm just getting only 5 items in the json response dictionary.

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

I need Created By and Last Modified TimeStamp along with this response. I'm using Box V2 iOS SDK. Need help on getting this.

You can specify which fields you want like this:

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
}];

Be sure to list whichever fields you need when creating the BoxFoldersRequestBuilder .

If you add the fields paramater and separate the items you want returned by comma, Box's response will return created_by and modifed_at. You can also retrieve modifed_by.

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

?fields=created_by,modified_at

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM