Getting the file’s metadata
To get the details of a file you can use the Get File API endpoint. You can also use this endpoint to retrieve a new temporary pre-signed URL to download a file if the previous pre-signed URL has already expired.Listing existing files of a bot
To list all the files of a bot you can use the List Files API endpoint.Filtering by tag values
If you need to filter files by tags, pass in thetags parameter, which is an object containing tags as key-value pairs. This will only return files that include all the tags (and corresponding values) that you specify.
Advanced tag filtering
Instead of passing in the value of a tag, you can pass in an object with theexists, not or in properties to allow for more advanced filtering.
exists
Use the exists property to specify whether a tag should be present or absent on the returned files:
not
Use the not property to specify a value (or an array of values) to exclude for a given tag:
in
Use the in property to specify a value (or an array of values) to include for a given tag:
Pagination
The List Files API endpoint will return by default the 20 most recent files your bot has. If you need to list older files you can use thenextToken property returned in the API response to retrieve the next page (if any) of files. The nextToken will be included for each page if there are files remaining to be listed.
For example: