FAQ

Contains some frequently asked questions about the documents API.

Which File Types are valid?

The Documents API supports the following file types:

  • doc
  • docx
  • pdf
  • tiff
  • png
  • jpg
  • jpeg

Is there a maximum document size?

Yes, the maximum file size that can be uploaded is 5MB after conversion to base64. This will often require having an actual document maximum size of around 3-4MB as the base64 encoding increases the content size.

How do I base64 encode my document?

On Mac OS & Linux

  1. Open your Terminal
  2. Run this
base64 -i <the file you wish to encode> -o <a file to output your base64 content to>
base64 -i /Users/dave/example/Document-Sample.pdf -o /Users/dave/example/output.txt
  1. This will generate an output.txt file that contains the base64 encoded document that can then be uploaded in the API

On Windows

  1. Open the Windows Terminal
  2. Create a temporary base64 file with
certutil -encode <the file you wish to encode> tmp.b64
  1. Clean the temporary file to produce a valid base64 string stored in data.b64
findstr /v /c:- tmp.b64 > data.b64

How do I decode my base64 encoded document?

On Mac OS & Linux

  1. Save the base64 string to be decoded into an input.txt document
  2. Open your Terminal
  3. Run this
base64 -d -i input.txt -o output-document.pdf
  1. This will create a new file called output-document.pdf which will be your document!

On Windows

  1. Save the base64 string to be decoded into an input.txt document
  2. Open the Windows Terminal
  3. Run this
certutil -decode input.txt output-document.pdf
  1. This will create a new file called output-document.pdf which will be your document!

Did this page help you?