NULL PDF Exception

This article was translated from English: Does it need improvement?
Translated
View the article in English

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.

ご注意Be sure to check the parameter syntax, the file path of the PDF file, or the validity of the PDF stream.

ヒントEnsure 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
テクニカルライター

Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。

開発以外にも、CurtisはIoT(Internet of Things)への強い関心を持ち、ハードウェアとソフトウェアの統合方法を模索しています。余暇には、ゲームをしたりDiscordボットを作成したりして、技術に対する愛情と創造性を組み合わせています。

準備はいいですか?
バージョン: 2024.10 ただ今リリースされました