Appearance
Download all client files via the Amiqus API
This guide demonstrates how to download all files associated with a client using the Amiqus API. Instead of manually fetching files, you can automate the process by combining several endpoints to list clients, retrieve file details and download each file programmatically. This is especially useful if you have not previously had an integration with Amiqus but have been using us for a while and want to backdate the files you have a copy of.
Prerequisites
- Amiqus API credentials: Ensure you have valid API credentials to authenticate your requests.
Overview of the flow
Below is a sequence diagram illustrating the process:
Step-by-step Guide
1. List all clients
Start by retrieving a list of clients. You can apply filters based on your criteria if necessary.
The response will contain an array of client objects. Use the client IDs from these objects in subsequent steps.
2. Retrieve files for each client
For each client obtained in Step 1, call the API endpoint to list their files. This will return a list of file objects associated with the client.
Loop through the returned list of clients in your code, calling this endpoint for each client to return a list of files.
3. Download each file
After gathering the file IDs for each client, iterate through the file list and download each file using its unique ID using the download a file for a client endpoint. You will need both the file ID and the client ID for this step.
What happens next?
After downloading the files:
- Monitor API limits: Keep an eye on your API rate limits to prevent throttling, especially if you are downloading files for a large number of clients.