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 tags
If you need to filter files by tags, you can just pass thetags
parameter which should be an object with key-value pairs of tags a file must have in order to be returned. Tag filtering works in an “AND” fashion, so only the files that have all the specified tags will be returned.
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: