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

NameDescriptionTypeRequired
idThe id of the file to download, obtained in the result of a pipeline.StringYes

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 codeDescription
400 - Bad RequestThe request was unacceptable, often due to missing or invalid file id.
401 - UnauthorizedNo valid API key provided.
404 - Not foundThe requested file doesn't exist.
429 - Too Many RequestsToo many requests hit the API too quickly.
5xx - Server ErrorsSomething went wrong on our end.