You are viewing limited content. For full access, please sign in.

Question

Question

Is PDF the only content type accepted by the Laserfiche API Document Import?

asked on November 1, 2023

In the guide for Importing a Document using the Laserfiche API everything revolves around PDF document types.

The content type is already set to 

Content-Type: application/pdf

without any alternatives

This syntax appears it is expecting only files with the PDF extension

<File.pdf>

From what I could see, I saw no information on sending something like a native document or another type of electronic document. Am I missing something or is PDF the only file type supported?

https://developer.laserfiche.com/guides/guide_importing-documents.html

0 0

Replies

replied on November 1, 2023 Show version history

Hi,

PDF is not the only file type supported.
You can, for instance, use the V2 Import API by selecting a TXT file, and using a request body like this:

{
  "name": "sample.txt",
  "autoRename": true,
  "importAsElectronicDocument": true,
}

Or a ZIP file with a request body like this:

{
  "name": "sample.zip",
  "autoRename": true,
}

The V1 Import API also supports these scenarios. 

For more information, please see this guide.

1 0
replied on November 2, 2023

Both the V2 guide and the V1 guide do not seem to have options for other file types specified.

How for example would I import a native document using either API?

Also where is the download for V2? I could only find this download searching the product downloads page

https://support.laserfiche.com/download/4180/laserfiche-api-server

0 0
replied on November 2, 2023

Would you please provide more details about the type of document you intend to import? 

V2 is not yet released for self-hosted. It's available only on Cloud.

0 0
replied on November 2, 2023

Oh V2 is only for Cloud, currently I am working with an On-Prem installation.

I would like to transfer a native Laserfiche document from Cloud to On-Prem. The type of document we get when we generate pages from a PDF for example.

In the documentation I can clearly see there is a content type but no list of which types are available to use besides PDF

Content-Disposition: form-data; name="electronicDocument"; filename="File.pdf"
Content-Type: application/pdf
<File.pdf>

 

0 0
replied on November 2, 2023

To transder the document from Cloud to On-Prem:

  1. The V2 Export API can be used to export the document to the desired format. The API returns a URI to the exported document (It is also possible to use the async version of the Export API, for which, the URI needs to be obtained by calling this Task API)
    • In the request body of both Export APIs, the parameter part determines the part of the document to be exported (i.e. Image, Text, or Edoc). If part=Image, then the parameter format can be used to decide the format of the output image (e.g. JPEG).
    • So, the exact type of the exported file depends on the request body (e.g. it can be a TIFF file or a PDF or a TXT file). 
  2. Having downloaded and locally stored the exported document from the URI, the V1 Import API can be used to move the document to the On-Prem repository.
    • For instane, if the export is done by part=Image and format=JPEG, then the import can be done by:
    • Content-Disposition: form-data; name="electronicDocument"; filename="File.jpg"
      Content-Type: image/jpeg
      <File.jpg>
      

 

0 0
replied on November 6, 2023 Show version history

When working with PDF files, we are using the tool Download Electronic Document to get PDF files from the repository. We then pass this to the <File.pdf> line of the On-Prem API call.

If we made this Export Call from within Cloud Workflow to it's own Cloud API, what activity would we use to get the document exported and provided as a link instead?

Originally I was thinking we could just use the tool Find Entry to get the native document as a token and use the output token to fill the <File.jpg> line.

0 0
replied on October 4, 2024

Following up on this. We have more customers looking to transfer native documents between On-Prem and Cloud

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.