7. Download Contents

You can download contents zip_file through REST API, using each content download URL. For the zip_file URL, you need to request a signed URL first.

The sample code below shows how to obtain Signed URL by passing fileURL and title and type of an item to ARGAuthCallback in ARGAuth of ARGSession class.

Objective-C
Swift
Objective-C
// Sample Code. Download Contents by Requesting Singed URL
ARGSession *argSession = [[ARGSession alloc] initWithARGConfig:argConfig error:&error];
ARGAuthCallback callback;
callback.Success = ^(NSString *url) {
// Download Contents from Signed URL
};
callback.Error = ^(ARGStatusCode code) {
};
[[argSession auth] requestSignedUrlWithUrl:fileUrl itemTitle:title itemType:type completion:callback];
Swift
// Sample Code. Download Contents by Requesting Singed URL
let callback: ARGAuthCallback = ARGAuthCallback(Success: { (url: String?) in
// Download Contents from Signed URL
}) { (code: ARGStatusCode) in
// error with status code
}
if let session = argSession, let auth = session.auth {
auth.requestSignedUrl(withUrl: fileUrl, itemTitle: title, itemType: type, completion: callback)
}