In this tutorial, we will show you how to set the output file to expire after 5 minutes using PDF.co and Make.
- Create a New Scenario
- Add PDF.co Module
- Setup PDF.co Configuration
- Run Scenario Result
- Add Delay Tools
- Set Delay Time
- Add Another Module
- Make an API Call Configuration
- Deleted File Result
We have here a sample scanned PDF and will convert it into a searchable PDF. We will use the output file and set it to expire after 5 minutes.
Step 1: Create a New Scenario
- First, log into your Make account and click on the Create a New Scenario button.
Step 2: Add PDF.co Module
- Next, search and select the PDF.co app. Then, choose the Make an API Call module.
Step 3: Setup PDF.co Configuration
Let’s set up the PDF.co configuration.
- For the API Endpoint Path field, we will use the
/v1/pdf/makesearchableendpoint. This endpoint will turn your scanned PDF into a text-searchable PDF.
- For the Input Type dropdown box, select the Override ‘url’ param with value.
- For the URL dropdown box, input the direct URL of your source file.
- Then, type in your desired Output File Name.
- Under the Body param, type
asyncfor the Key and set
truefor the Value.
- In the Forcely enable async mode dropdown box, select the No, rely on the async parameter in Body.
After setting up the configuration, let’s run the scenario.
Step 4: Run Scenario Result
- The scenario runs successfully. We will use this output file and set it to expire after 5 minutes.
Step 5: Add Delay Tools Module
- Now, let’s add the delay tools. So we can set the expiration time of the output file.
Step 6: Set Delay Time
- In the Delay dropdown box, set it to 300 in seconds. This is equivalent to 5 minutes before the output file expiration.
Once you are done setting up the Delay tools, let’s add another module to delete the expired file.
Step 7: Add Another Module
- Select the PDF.co app and choose the Make an API Call module.
Step 8: Make an API Call Configuration
Let’s set up the configuration.
- For the API Endpoint Path dropdown box, we will add the
/v1/delete/fileendpoint. This endpoint will automatically delete the temporary file after expiration.
- For the Input Type dropdown box, select the Upload files and inject as ‘url’ param to automatically input files from PDF.co – Make an API Call output.
Since we’re done setting up the configuration, let’s re-run the scenario to see the result.
Step 9: Deleted File Result
- Great! We successfully set the output file to expire after 5 minutes and delete the expired file automatically.
In this tutorial, you learned how to set the output file to expire after 5 minutes using Make. You also learned how to use the PDF.co Web API to delete the expired file.