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
Parameter | CLI option | Type | Required | Description |
---|---|---|---|---|
Bucket | --bucket | String | ✔ | Bucket name |
BasicData | --basic | Structure Of KeyAndValue | ✔ | Basic request data. See GetBasicDataStructure |
Prefix | --prefix | String | ✖ | Filtering by prefix, if necessary |
PageToken | --ctoken | String | ✖ | Page token if pagination is used |
Headers | --headers | Map Of KeyAndValue | ✖ | Additional request headers, if necessary |
Directory | --dir | Boolean | ✖ | True > 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 = "opi-dirbucket3";
Result = OPI_S3.ListObjects(Bucket, BasicData, , , , Directory);
- Bash
- CMD/Bat
oint s3 ListObjects \
--bucket "opi-dirbucket3" \
--basic "{'URL':'storage-155.s3hoster.by','AccessKey':'***','SecretKey':'***','Region':'BTC','Service':'s3'}" \
--dir true
oint s3 ListObjects ^
--bucket "opi-dirbucket3" ^
--basic "{'URL':'storage-155.s3hoster.by','AccessKey':'***','SecretKey':'***','Region':'BTC','Service':'s3'}" ^
--dir true
Result
{
"status": 200,
"response": {
"ListBucketResult": {
"Name": "opi-dirbucket3",
"Prefix": {},
"KeyCount": "1",
"MaxKeys": "250",
"IsTruncated": "false",
"Contents": {
"Key": "picture.jpg",
"LastModified": "2025-09-15T23:15:38.841Z",
"ETag": "\"9e0176f87f6565a22f78e0f9b39a4d78\"",
"Size": "2114023",
"StorageClass": "STANDARD"
}
}
},
"headers": {
"Accept-Ranges": "bytes",
"Date": "Mon, 15 Sep 2025 23:17:22 GMT",
"Server": "MinIO",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"Vary": "Origin, Accept-Encoding",
"X-Amz-Id-2": "e602da57d0c30b8c7034fcfe129917205f80f7bab979408e71da5d1441c85e79",
"X-Amz-Request-Id": "186597E5D6DE08C1",
"X-Content-Type-Options": "nosniff",
"X-XSS-Protection": "1; mode=block",
"Content-Length": "452",
"Content-Type": "application/xml"
}
}