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
1
// Sample Code. Download Contents by Requesting Singed URL
2
3
ARGSession *argSession = [[ARGSession alloc] initWithARGConfig:argConfig error:&error];
4
5
ARGAuthCallback callback;
6
callback.Success = ^(NSString *url) {
7
// Download Contents from Signed URL
8
};
9
10
callback.Error = ^(ARGStatusCode code) {
11
};
12
13
[[argSession auth] requestSignedUrlWithUrl:fileUrl itemTitle:title itemType:type completion:callback];
Copied!
1
// Sample Code. Download Contents by Requesting Singed URL
2
3
let callback: ARGAuthCallback = ARGAuthCallback(Success: { (url: String?) in
4
// Download Contents from Signed URL
5
}) { (code: ARGStatusCode) in
6
// error with status code
7
}
8
9
if let session = argSession, let auth = session.auth {
10
auth.requestSignedUrl(withUrl: zipFileUrl, itemTitle: title, itemType: type, completion: callback)
11
}
Copied!
Last modified 1yr ago
Copy link