NULL PDF Exception

The "ERROR-001" error occurs when there is no PDF file provided. This means that the required pdf_file parameter in the POST request was null or empty.

Please noteBe sure to check the parameter syntax, the file path of the PDF file, or the validity of the PDF stream.

TipsEnsure the pdf_file parameter is set to your PDF file in the POST request.

Example of pdf_file proper syntax in cURL:

curl -X POST 'https://api.securedoc.com/v1/document-services/pdfs/redact-text?words_to_redact=IRON' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@YOUR_PDF_DOCUMENT.pdf;type=application/pdf'
curl -X POST 'https://api.securedoc.com/v1/document-services/pdfs/redact-text?words_to_redact=IRON' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@YOUR_PDF_DOCUMENT.pdf;type=application/pdf'
SHELL

Refer to the final line for proper usage:

-F 'pdf_file=@YOUR_PDF_DOCUMENT.pdf;type=application/pdf'

Explanation

  • -X POST: Specifies the request method as POST.
  • URL: The API endpoint URL that processes the PDF document.
  • -H 'accept: */*': Header indicating the server can respond with any content type.
  • -H 'Content-Type: multipart/form-data': This header specifies that the POST request contains a form with data, which can be files and parameters.
  • -F 'pdf_file=@YOUR_PDF_DOCUMENT.pdf;type=application/pdf': This flag uploads a file; the @ symbol before the file name indicates that the name after the @ is a file path. The type=application/pdf ensures that it is treated as a PDF.

Make sure that the path to YOUR_PDF_DOCUMENT.pdf exists and points to the actual PDF file you want to use.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...

Read More
Ready to Get Started?
Version: 2024.10 just released