To get started
- Get familiarized with the different API endpoints available.
- Review the instructions on how to authenticate with the API.
- Check out the How-To guides (see left sidebar) for examples on how to use the Files API in different scenarios.
- Try calling the list files API endpoint as shown below.
Using cURL
Calling the Files API can be done using any HTTP client, such ascurl, axios, or fetch. Here’s an example using curl:
Using the Official TypeScript Client
The official TypeScript client is available as an NPM package. You can install it using any of the following command:This example uses
dotenv to manage Botpress credentials. If you’d rather manage your credentials differently, just remove the import and define your token and bot ID however you like.Security
Access Policies
A file can specify a list of special access policies:public_content: Unauthenticated users can read contents (but not metadata) of the file through a unique permanent URL provided by the API for each file. Without this policy the file URL returned by the API will be temporary and will expire after a short period of time.integrations: Grants read, search, list access to all integrations of the bot that owns the file.
Permissions
NoteThe List Files API endpoint will filter out files that aren’t accessible to the user calling that API endpoint.