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 Data Type Definition
name String A mandatory parameter. Will hold the name of the object.
versionId String An optional parameter. Will hold the unique version ID of the required object's version.
    
copy
try { ZCatalystBucket bucket = stratus.bucket("testing"); var (response, object) = await bucket.getObject("SunSet.jpeg", "01hter85pvexb8s2s2842rpswh"); print('Object Name : ${object.name}'); } on ZCatalystException catch (ex) { print(ex.toString()); }

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.
continuationToken String An Optional parameter. If the response was truncated, the value of this key must be passed as continuationToken to the same method for retrieving the next set of objects.
    
copy
try { ZCatalystBucket bucket = app.stratus.bucket("testing"); var (response, objects, resInfo) = await bucket.getObjects(maxKeys: 5); for (var object in objects) { print('Object Name : ${object.name}'); } print('Res Info MaxKeys:${resInfo.maxKeys}'); print('\n\n'); } on ZCatalystException catch (ex) { print(ex.toString()); }

Last Updated 2025-07-02 15:43:56 +0530 +0530