Set an API File response
Function: Set an API File response
This action allows you to specify a file that will be sent back as the response when your API is called. Instead of sending back text or structured data, you can use this to return a document, an image, or any other file type directly from your API.
Input
- File: This is the file you want your API to send back as its response. You must provide a file for this action to work.
Execution Flow
Real-Life Examples
Here are some examples of how you can use the "Set an API File response" action:
-
Providing a downloadable report:
- Inputs:
- File: A PDF file named "Monthly_Sales_Report.pdf" that was generated earlier in your workflow.
- Result: When your API is accessed, it will directly send the "Monthly_Sales_Report.pdf" file to the user, allowing them to download it.
- Inputs:
-
Serving an image from your application:
- Inputs:
- File: An image file named "Product_Hero_Image.jpg" that is stored in your application's file storage.
- Result: If a user requests a specific product image through your API, this action will return the "Product_Hero_Image.jpg" file, which can then be displayed in their browser or application.
- Inputs:
-
Returning a configuration file:
- Inputs:
- File: A text file named "config.txt" containing specific settings for an external system.
- Result: When an external system calls your API to retrieve its configuration, this action will provide the "config.txt" file directly, ensuring it receives the necessary settings.
- Inputs: