Download
GET https://api.visualpdf.com/v1/download/{id}
Download a file generated by a pipeline processing.
Only files generated by pipelines completed less than 1 hour ago are available for download.
Path parameters
Name | Description | Type | Required |
---|---|---|---|
id | The id of the file to download, obtained in the result of a pipeline. | String | Yes |
Example
Request (NodeJS)
const form = new FormData();
// Adding files, tasks and options to the form...
const pipelineResponse = await fetch(
'https://api.visualpdf.com/v1/process',
{
method: 'POST',
body: form,
headers: { Authorization: `Bearer ${my_API_key}` },
},
);
const pipelineResult = await pipelineResponse.json();
// Downloading the first generated PDF
const fileResponse = await fetch(
pipelineResult.files[0].link,
{
method: 'GET',
headers: { Authorization: `Bearer ${my_API_key}` },
},
);
// Saving the file into a JavaScript File object
const file = new File([await fileResponse.blob()], pipelineResult.files[0].name, { type: 'application/pdf' });
Response
The binary data of the file.
Errors
HTTP code | Description |
---|---|
400 - Bad Request | The request was unacceptable, often due to missing or invalid file id. |
401 - Unauthorized | No valid API key provided. |
404 - Not found | The requested file doesn't exist. |
429 - Too Many Requests | Too many requests hit the API too quickly. |
5xx - Server Errors | Something went wrong on our end. |