8. Download Contents

You can download contents zip_files through the REST API, using each item's zip_file URL. To download the zip_file, you first need to request a signed URL through the ARGAuth member of an initialized ARGSession.

The sample code below shows how to obtain a Signed URL by passing an item's zip_file URL, title, type, and the implemented ARGAuthCallback to the ARGAuth requestSignedUrl function.

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: zipFileUrl, itemTitle: title, itemType: type, completion: callback)
}