Get Object
This SDK method can be used to get an object from the bucket. The response will be in blob format.
When Versioning is enabled for the bucket:
- If you do not pass the versionId, then only the latest object will be returned.
- To retrieve a specific version, use the versionId query parameter with a valid version as a value.
Parameters Used
Parameter Name | Definition |
---|---|
objectKey | A mandatory parameter. Will contain the object name. |
versionId | An optional parameter. Will hold the unique version ID of the required object's version. |
copy
bucketInstance.getObject( objectKey : "{object_name}", versionId : "{version_id}" ) { result in
switch result {
case .success( let object ) :
print( "File Name : \( object.fileName )" )
case .error(let error) :
print("Error : \( error )")
}
}
The required object will be returned.
Possible Exception
- 404: Object or Bucket Not Found
Get All Objects
This SDK method can be used to get all the objects present in the bucket using pagination technique.
Parameters Used
Parameter Name | Data Type | Definition |
---|---|---|
prefix | String | An Optional parameter. This will get the objects that match the prefix value. |
maxKeys | Number | An Optional parameter. Will contain the maximum limit of objects that can be listed by pagination. |
continuation_token | String | An Optional parameter. If the response was truncated, the value of this key must be passed as continuation_token to the same method for retrieving the next set of objects. |
copy
var params = ZCatalystQuery.ObjectParams()
params.maxKeys = 10
params.continuationToken = "{continuation_token}"
parmas.prefix = "{prefix}"
bucketInstance.getObjects( withParams : params ) { result in
switch result {
case .success( let objects, let response ) :
for object in objects {
print("File Name : \( object.fileName )")
}
case .error( let error ) :
print("Error : \( error )")
}
}
The required object will be returned as an array in Blob format.
Possible Exception
- 404: Object or Bucket Not Found
Last Updated 2025-08-28 12:01:44 +0530 IST
Yes
No
Send your feedback to us
Skip
Submit