Skip to main content

List objects

Gets the list of objects in the selected bucket

Function ListObjects(Val Bucket, Val BasicData, Val Prefix = "", Val PageToken = "", Val Headers = Undefined, Val Directory = False) Export

ParameterCLI optionTypeRequiredDescription
Bucket--bucketStringBucket name
BasicData--basicStructure Of KeyAndValueBasic request data. See GetBasicDataStructure
Prefix--prefixStringFiltering by prefix, if necessary
PageToken--ctokenStringPage token if pagination is used
Headers--headersMap Of KeyAndValueAdditional request headers, if necessary
Directory--dirBooleanTrue > Path style URL, False > Virtual hosted style URL

Returns: Structure Of KeyAndValue - serialized JSON response from storage

tip

Method at AWS documentation: ListObjectsV2


1C:Enterprise/OneScript code example
    URL       = "storage-155.s3hoster.by";
AccessKey = "BRN5RKJE67...";
SecretKey = "NNhv+i9PrytpT8Tu0C1N...";
Region = "BTC";

BasicData = OPI_S3.GetBasicDataStructure(URL, AccessKey, SecretKey, Region);

Directory = True; // Formation URL in path-style
Bucket = "";
Result = OPI_S3.ListObjects(Bucket, BasicData, , , , Directory);
    # JSON data can also be passed as a path to a .json file

oint s3 ListObjects \
--bucket "d09ba45c" \
--basic "{'URL':'storage-564.s3hoster.by','AccessKey':'***','SecretKey':'***','Region':'BTC','Service':'s3'}" \
--dir true
Result
{
"status": 200,
"response": {
"ListBucketResult": {
"Name": "d09ba45c",
"Prefix": {},
"KeyCount": "***",
"MaxKeys": "***",
"IsTruncated": "false",
"Contents": {
"Key": "***",
"LastModified": "2025-12-10T20:35:21.435Z",
"ETag": "\"9e0176f87f6565a22f78e0f9b39a4d78\"",
"Size": "2114023",
"StorageClass": "STANDARD"
}
}
},
"headers": {
"Accept-Ranges": "bytes",
"Date": "Wed, 10 Dec 2025 20:44:29 GMT",
"Server": "MinIO",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"Vary": "Origin, Accept-Encoding",
"X-Amz-Id-2": "0eb49e91e4cb899a0af3fcfe75973892594fa8211551eba0f72840fc567c152b",
"X-Amz-Request-Id": "187FF576B4B16A00",
"X-Content-Type-Options": "nosniff",
"X-XSS-Protection": "1; mode=block",
"Content-Length": "446",
"Content-Type": "application/xml"
}
}