REST API for IronSecureDoc

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

This is the REST API Reference for your instance of IronSecureDoc. This tutorial assumes you already have a container instance running. If you are looking to Get Started please follow our Guide.

Jump to features:

ヒント

  • The placeholder of http://localhost:8080/ will be used for the URL in all examples. Please ensure you replace it with your URL.
  • Make sure to replace the placeholder values (e.g., path/to/your/file.pdf, certificate_password, etc.) with actual values.
  • The author, title, and subject headers are included in all request examples.

[GET] Health Check

Endpoint: http://localhost:8080/v1/document-services/ping

Health check endpoint to verify that the server is running.

Response: 200 OK: pong


[GET] Check License

Endpoint: http://localhost:8080/v1/document-services/check-license

Verifies the validity of the license.

Response: 200 OK: Valid


[POST] Redact Text

Endpoint: http://localhost:8080/v1/document-services/pdfs/redact-text

Hides sensitive words in a PDF format document using true redaction. Include a PDF file as a pdf_file object in the request body.

Required Request Body Parameters

Name Data Type Description
pdf_file application/pdf file The PDF file to redact.
words_to_redact array[string] An array of words to be redacted from the document.

Optional Request Body Parameters

Name Data Type Default Description
user_password string null User password for the input PDF. Required if the PDF has a user password to grant read access.
owner_password string null Owner password for the input PDF. Required if the PDF has an owner password to grant access to make modifications.
specific_pages array[int] null Optionally specify pages to apply to. If left empty, all pages will apply.
draw_black_box bool True Have a Black Box drawn over redacted text areas.
match_whole_word bool True Allow partial matches within words be redacted too.
match_case bool null Match case for the words to be redacted.
overlay_text string null If your prefer an Overlay Text on the redaction area such as words or symbols, set them here. If not set, a blank character will be used.
save_as_pdfa bool False Save the PDF with PDF/A-3 compliance.
save_as_pdfua bool False Save the PDF with PDF/UA compliance.

Optional Headers

Name Data Type Description
author string Set the PDF Metadata Author property.
title string Set the PDF Metadata Title property.
subject string Set the PDF Metadata Subject property.

Example:

Request

Required Parameters Only:

curl -X POST 'http://localhost:8080/v1/document-services/pdfs/redact-text' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'words_to_redact=pdf' \
  -F 'draw_black_box=true' \
  -F 'match_whole_word=true' \
  -F 'match_case=true' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/redact-text' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'words_to_redact=pdf' \
  -F 'draw_black_box=true' \
  -F 'match_whole_word=true' \
  -F 'match_case=true' \
SHELL

All Required and Optional Parameters:

curl -X POST 'http://localhost:8080/v1/document-services/pdfs/redact-text' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'words_to_redact=word1' \
  -F 'words_to_redact=word2' \
  -F 'draw_black_box=true' \
  -F 'match_whole_word=true' \
  -F 'match_case=true' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
  -F 'overlay_text=REDACTED' \
  -F 'specific_pages=0' \
  -F 'specific_pages=1' \
  -F 'save_as_pdfa=false' \
  -F 'save_as_pdfua=false' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/redact-text' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'words_to_redact=word1' \
  -F 'words_to_redact=word2' \
  -F 'draw_black_box=true' \
  -F 'match_whole_word=true' \
  -F 'match_case=true' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
  -F 'overlay_text=REDACTED' \
  -F 'specific_pages=0' \
  -F 'specific_pages=1' \
  -F 'save_as_pdfa=false' \
  -F 'save_as_pdfua=false' \
SHELL

Response:

  • 200 OK with the redacted PDF file attached.

[POST] Redact Regular Expression

Endpoint: http://localhost:8080/v1/document-services/pdfs/redact-regular-expression

Hides sensitive Regular Expression matches (such as dates, names, or patterns) in a PDF format document using true redaction. Include a PDF file as a pdf_file object in the request body.

Required Request Body Parameters

Name Data Type Description
pdf_file application/pdf file The PDF file to redact.
regular_expression string Regular Expression from which matching cases will be redacted from the document.

Optional Request Body Parameters

Name Data Type Default Description
user_password string null User password for the input PDF. Required if the PDF has a user password to grant read access.
owner_password string null Owner password for the input PDF. Required if the PDF has an owner password to grant access to make modifications.
specific_pages array[int] null Optionally specify pages to apply to. If left empty, all pages will apply.
draw_black_box bool True Have a Black Box drawn over redacted text areas.
overlay_text string null If your prefer an Overlay Text on the redaction area such as words or symbols, set them here. If not set, a blank character will be used.
save_as_pdfa bool False Save the PDF with PDF/A-3 compliance.
save_as_pdfua bool False Save the PDF with PDF/UA compliance.

Optional Headers

Name Data Type Description
author string Set the PDF Metadata Author property.
title string Set the PDF Metadata Title property.
subject string Set the PDF Metadata Subject property.

Example:

Request

Required Parameters Only:

curl -X POST 'http://localhost:8080/v1/document-services/pdfs/redact-regular-expression' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'regular_expression="[0-9]"' \
  -F 'draw_black_box=true' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/redact-regular-expression' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'regular_expression="[0-9]"' \
  -F 'draw_black_box=true' \
SHELL

All Required and Optional Parameters:

curl -X POST 'http://localhost:8080/v1/document-services/pdfs/redact-regular-expression' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'regular_expression="[0-9]"' \
  -F 'draw_black_box=true' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
  -F 'overlay_text=*' \
  -F 'specific_pages=0' \
  -F 'specific_pages=1' \
  -F 'save_as_pdfa=false' \
  -F 'save_as_pdfua=false' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/redact-regular-expression' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'regular_expression="[0-9]"' \
  -F 'draw_black_box=true' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
  -F 'overlay_text=*' \
  -F 'specific_pages=0' \
  -F 'specific_pages=1' \
  -F 'save_as_pdfa=false' \
  -F 'save_as_pdfua=false' \
SHELL

Response:

  • 200 OK with the redacted PDF file attached.

[POST] Redact Region

Endpoint: http://localhost:8080/v1/document-services/pdfs/redact-region

Hides sensitive text in a specific region of a PDF document using true redaction. Include a PDF file as a pdf_file object in the request body.

Required Request Body Parameters

Name Data Type Description
pdf_file application/pdf file The PDF file to redact.
region_to_redact_x float X coordinate of the region to redact, starting from the bottom-left of the page.
region_to_redact_y float Y coordinate of the region to redact, starting from the bottom-left of the page.
region_to_redact_w float Width of the region to redact, starting from the specified X coordinate.
region_to_redact_h float Height of the region to redact, starting from the specified Y coordinate.

Optional Request Body Parameters

Name Data Type Default Description
user_password string null User password for the input PDF. Required if the PDF has a user password to grant read access.
owner_password string null Owner password for the input PDF. Required if the PDF has an owner password to grant access to make modifications.
specific_pages array[int] null Optionally specify pages to apply to. If left empty, all pages will apply.
draw_black_box bool True Have a Black Box drawn over redacted text areas.
save_as_pdfa bool False Save the PDF with PDF/A-3 compliance.
save_as_pdfua bool False Save the PDF with PDF/UA compliance.

Optional Headers

Name Data Type Description
author string Set the PDF Metadata Author property.
title string Set the PDF Metadata Title property.
subject string Set the PDF Metadata Subject property.

Example:

Request

Required Parameters Only:

curl -X POST 'http://localhost:8080/v1/document-services/pdfs/redact-region' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'region_to_redact_x=100' \
  -F 'region_to_redact_y=150' \
  -F 'region_to_redact_w=500' \
  -F 'region_to_redact_h=400' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/redact-region' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'region_to_redact_x=100' \
  -F 'region_to_redact_y=150' \
  -F 'region_to_redact_w=500' \
  -F 'region_to_redact_h=400' \
SHELL

All Required and Optional Parameters:

curl -X POST 'http://localhost:8080/v1/document-services/pdfs/redact-region' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
  -F 'region_to_redact_x=100' \
  -F 'region_to_redact_y=150' \
  -F 'region_to_redact_w=500' \
  -F 'region_to_redact_h=400' \
  -F 'specific_pages=0' \
  -F 'specific_pages=1' \
  -F 'save_as_pdfa=false' \
  -F 'save_as_pdfua=false' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/redact-region' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
  -F 'region_to_redact_x=100' \
  -F 'region_to_redact_y=150' \
  -F 'region_to_redact_w=500' \
  -F 'region_to_redact_h=400' \
  -F 'specific_pages=0' \
  -F 'specific_pages=1' \
  -F 'save_as_pdfa=false' \
  -F 'save_as_pdfua=false' \
SHELL

Response:

  • 200 OK with the redacted PDF file attached.

[POST] Certify / Apply Digital Signature

Endpoint: http://localhost:8080/v1/document-services/pdfs/certify

Adds a certification to a PDF document to assert that it has not been tampered with by means of a Certificate file (.p12, .pfx). Include a PDF file as a pdf_file object in the request body, and a certificate file as a certificate_file object in the request body.

Required Request Body Parameters

Name Data Type Description
pdf_file application/pdf file The PDF file to certify.
certificate_file application/x-pkcs12 file The certificate file (.p12, .pfx) to use for certification.
certificate_password string Password for the provided certificate file.
certificate_permissions int
certificate_permissions value Permissions
1 No Changes Allowed. Any further document changes will invalidate the signature.
2 Only Additional Signatures and Form Filling Allowed.
3 Only AdditionalSignatures, Form Filling, and Annotations Allowed

Optional Request Body Parameters

Name Data Type Default Description
user_password string null User password for the input PDF. Required if the PDF has a user password to grant read access.
owner_password string null Owner password for the input PDF. Required if the PDF has an owner password to grant access to make modifications.
save_as_pdfa bool False Save the PDF with PDF/A-3 compliance.
save_as_pdfua bool False Save the PDF with PDF/UA compliance.

Optional Headers

Name Data Type Description
author string Set the PDF Metadata Author property.
title string Set the PDF Metadata Title property.
subject string Set the PDF Metadata Subject property.

Example:

Request

Required Parameters Only:

curl -X POST 'http://localhost:8080/v1/document-services/pdfs/certify' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'certificate_file=@sample.pfx;type=application/x-pkcs12' \
  -F 'certificate_password=p4ssw0rd' \
  -F 'certificate_permissions=1' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/certify' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'certificate_file=@sample.pfx;type=application/x-pkcs12' \
  -F 'certificate_password=p4ssw0rd' \
  -F 'certificate_permissions=1' \
SHELL

All Required and Optional Parameters:

curl -X POST 'http://localhost:8080/v1/document-services/pdfs/certify' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'certificate_file=@sample.pfx;type=application/x-pkcs12' \
  -F 'certificate_password=p4ssw0rd' \
  -F 'certificate_permissions=1' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
  -F 'save_as_pdfa=false' \
  -F 'save_as_pdfua=false' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/certify' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'certificate_file=@sample.pfx;type=application/x-pkcs12' \
  -F 'certificate_password=p4ssw0rd' \
  -F 'certificate_permissions=1' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
  -F 'save_as_pdfa=false' \
  -F 'save_as_pdfua=false' \
SHELL

Response:

  • 200 OK with the certified PDF file attached.

[POST] Sign with Signature and Certificate

Endpoint: http://localhost:8080/v1/document-services/pdfs/sign

Adds an image and certification to that image in a PDF document to assert that it has not been tampered with by means of a Certificate file (.p12, .pfx). Include a PDF file as a pdf_file object in the request body, and a certificate file as a certificate_file object in the request body.

Required Request Body Parameters

Name Data Type Description
pdf_file application/pdf file The PDF file to certify.
signature_image_file image/jpeg or image/png file The signature image (.png, .jpg, .jpeg) to use for certification. Can be a logo, autograph, etc.
certificate_file application/x-pkcs12 file The certificate file (.p12, .pfx) to use for certification.
certificate_password string Password for the provided certificate file.
certificate_permissions int
certificate_permissions value Permissions
1 No Changes Allowed. Any further document changes will invalidate the signature.
2 Only Additional Signatures and Form Filling Allowed.
3 Only AdditionalSignatures, Form Filling, and Annotations Allowed

sign_specific_page int Specify page to apply the image and certificate to. First page is 0. If left empty, only first page will apply.
signature_image_x float The X coordinate of the Rectangle region of the signature image. This starts from the top-left of the page.
signature_image_y float The Y coordinate of the Rectangle region of the signature image. This starts from the top-left of the page.
signature_image_w float The Width of the Rectangle region of the signature image. This starts from the top-left of the page.
signature_image_h float The Height of the Rectangle region of the signature image. This starts from the top-left of the page.

Optional Request Body Parameters

Name Data Type Default Description
user_password string null User password for the input PDF. Required if the PDF has a user password to grant read access.
owner_password string null Owner password for the input PDF. Required if the PDF has an owner password to grant access to make modifications.
specific_pages array[int] null Optionally specify pages to apply to. If left empty, all pages will apply.
save_as_pdfa bool False Save the PDF with PDF/A-3 compliance.
save_as_pdfua bool False Save the PDF with PDF/UA compliance.

Optional Headers

Name Data Type Description
author string Set the PDF Metadata Author property.
title string Set the PDF Metadata Title property.
subject string Set the PDF Metadata Subject property.

Example:

Request

Required Parameters Only:

curl -X POST 'http://localhost:8080/v1/document-services/pdfs/sign' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'signature_image_file=@autograph.png;type=image/png' \
  -F 'certificate_file=@sample.pfx;type=application/x-pkcs12' \
  -F 'certificate_password=p4ssw0rd' \
  -F 'certificate_permissions=1' \
  -F 'sign_specific_page=0' \
  -F 'signature_image_x=100' \
  -F 'signature_image_y=150' \
  -F 'signature_image_w=500' \
  -F 'signature_image_h=400' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/sign' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'signature_image_file=@autograph.png;type=image/png' \
  -F 'certificate_file=@sample.pfx;type=application/x-pkcs12' \
  -F 'certificate_password=p4ssw0rd' \
  -F 'certificate_permissions=1' \
  -F 'sign_specific_page=0' \
  -F 'signature_image_x=100' \
  -F 'signature_image_y=150' \
  -F 'signature_image_w=500' \
  -F 'signature_image_h=400' \
SHELL

All Required and Optional Parameters:

curl -X POST 'http://localhost:8080/v1/document-services/pdfs/sign' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'signature_image_file=@autograph.png;type=image/png' \
  -F 'certificate_file=@sample.pfx;type=application/x-pkcs12' \
  -F 'certificate_password=p4ssw0rd' \
  -F 'certificate_permissions=1' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
  -F 'save_as_pdfa=false' \
  -F 'save_as_pdfua=false' \
  -F 'sign_specific_page=0' \
  -F 'signature_image_x=100' \
  -F 'signature_image_y=150' \
  -F 'signature_image_w=500' \
  -F 'signature_image_h=400' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/sign' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'signature_image_file=@autograph.png;type=image/png' \
  -F 'certificate_file=@sample.pfx;type=application/x-pkcs12' \
  -F 'certificate_password=p4ssw0rd' \
  -F 'certificate_permissions=1' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
  -F 'save_as_pdfa=false' \
  -F 'save_as_pdfua=false' \
  -F 'sign_specific_page=0' \
  -F 'signature_image_x=100' \
  -F 'signature_image_y=150' \
  -F 'signature_image_w=500' \
  -F 'signature_image_h=400' \
SHELL

Response:

  • 200 OK with the certified PDF file attached.

[POST] Verify Signatures

Endpoint: http://localhost:8080/v1/document-services/pdfs/verify-signatures

Verifies that the signatures within the PDF file are valid.

Required Request Body Parameters

Name Data Type Description
pdf_file application/pdf file The PDF file to encrypt.

Optional Request Body Parameters

Name Data Type Default Description
user_password string null User password for the input PDF. Required if the PDF has a user password to grant read access.
owner_password string null Owner password for the input PDF. Required if the PDF has an owner password to grant access to make modifications.

Example:

Request

Required Parameters Only:

curl -X POST 'https://api.securedoc.com/v1/document-services/pdfs/verify-signatures' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
curl -X POST 'https://api.securedoc.com/v1/document-services/pdfs/verify-signatures' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
YAML

All Required and Optional Parameters:

curl -X POST 'https://api.securedoc.com/v1/document-services/pdfs/verify-signatures' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
curl -X POST 'https://api.securedoc.com/v1/document-services/pdfs/verify-signatures' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
YAML

Response:

  • 200 OK if there are signatures and they are all valid
  • 400 Bad Request if there are no signatures or at least one is invalid.

[POST] Encrypt / Add Password & Permissions

Endpoint: http://localhost:8080/v1/document-services/pdfs/encrypt

Adds a layer of security to a PDF document by encrypting it with a user and owner password. Include a PDF file as a pdf_file object in the request body.

Required Request Body Parameters

Name Data Type Description
pdf_file application/pdf file The PDF file to encrypt.
allow_extracting_content bool Allow the extraction of content from the PDF file.
allow_form_filling bool Allow the filling of forms in the resulting PDF.
allow_annotations bool Allow the addition or modification of annotations in the resulting PDF.
allow_printing bool Allow printing of the resulting PDF.
allow_modifications bool Allow modifications to the resulting PDF.
new_owner_password string New owner password for the output PDF. Grants full access, including changing permissions and passwords.

Optional Request Body Parameters

Name Data Type Default Description
user_password string null User password for the input PDF. Required if the PDF has a user password to grant read access.
owner_password string null Owner password for the input PDF. Required if the PDF has an owner password to grant access to make modifications.
new_user_password string null New user password for the output PDF. Grants read access and other specified permissions.
save_as_pdfa bool False Save the PDF with PDF/A-3 compliance.
save_as_pdfua bool False Save the PDF with PDF/UA compliance.

Optional Headers

Name Data Type Description
author string Set the PDF Metadata Author property.
title string Set the PDF Metadata Title property.
subject string Set the PDF Metadata Subject property.

Example:

Request

Required Parameters Only:

curl -X POST 'http://localhost:8080/v1/document-services/pdfs/encrypt' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'allow_extracting_content=true' \
  -F 'allow_form_filling=true' \
  -F 'allow_annotations=true' \
  -F 'allow_printing=true' \
  -F 'allow_modifications=false' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/encrypt' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'allow_extracting_content=true' \
  -F 'allow_form_filling=true' \
  -F 'allow_annotations=true' \
  -F 'allow_printing=true' \
  -F 'allow_modifications=false' \
SHELL

All Required and Optional Parameters:

curl -X POST 'http://localhost:8080/v1/document-services/pdfs/encrypt' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'allow_extracting_content=true' \
  -F 'allow_form_filling=true' \
  -F 'allow_annotations=true' \
  -F 'allow_printing=true' \
  -F 'allow_modifications=false' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
  -F 'new_user_password=p4ssw0rd' \
  -F 'save_as_pdfa=false' \
  -F 'save_as_pdfua=false' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/encrypt' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'allow_extracting_content=true' \
  -F 'allow_form_filling=true' \
  -F 'allow_annotations=true' \
  -F 'allow_printing=true' \
  -F 'allow_modifications=false' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
  -F 'new_user_password=p4ssw0rd' \
  -F 'save_as_pdfa=false' \
  -F 'save_as_pdfua=false' \
SHELL

Response:

  • 200 OK with the encrypted PDF file attached.

[POST] Extract Text from a Document

Endpoint: http://localhost:8080/v1/document-services/pdfs/extract

Extracts text embedded in the pages of a document. Include a PDF file as a pdf_file object in the request body.

Required Request Body Parameters

Name Data Type Description
pdf_file application/pdf file The PDF file to encrypt.

Optional Request Body Parameters

Name Data Type Default Description
user_password string null User password for the input PDF. Required if the PDF has a user password to grant read access.
owner_password string null Owner password for the input PDF. Required if the PDF has an owner password to grant access to make modifications.
specific_pages array[int] null Optionally specify pages to apply to. If left empty, all pages will apply.

Example:

Request

Required Parameters Only:

curl -X POST 'http://localhost:8080/v1/document-services/pdfs/extract' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/extract' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
SHELL

All Required and Optional Parameters:

curl -X POST 'http://localhost:8080/v1/document-services/pdfs/extract' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
  -F 'specific_pages=0' \
  -F 'specific_pages=1' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/extract' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
  -F 'specific_pages=0' \
  -F 'specific_pages=1' \
SHELL

Response:

  • 200 OK with the extracted text as a response.

[POST] Verify Document Password

Endpoint: http://localhost:8080/v1/document-services/pdfs/verify-password

Verifies that the user and owner passwords supplied are valid for the pdf_file.

Required Request Body Parameters

Name Data Type Description
pdf_file application/pdf file The PDF file.
user_password string User password for the input PDF. Required if the PDF has a user password to grant read access.
owner_password string Owner password for the input PDF.

Example:

Request

Required Parameters Only:

curl -X POST 'http://localhost:8080/v1/document-services/pdfs/verify-password' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/verify-password' \
  -H 'accept: */*' \
  -H 'author: Iron Software | IRONSECUREDOC' \
  -H 'title: WEBSITE DEMO 2024' \
  -H 'subject: DEMO EXAMPLE' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@sample.pdf;type=application/pdf' \
  -F 'user_password=password' \
  -F 'owner_password=5yug2RT45th32h78' \
SHELL

Response:

  • 200 OK

よくある質問

IronSecureDoc REST API の目的は何ですか?

IronSecureDoc REST API は、開発者が PDF ドキュメントを保護および管理するのを支援するために設計されており、テキストの編集、デジタル署名の適用、ドキュメントの暗号化、パスワードの検証などの機能を提供します。

IronSecureDoc API を使用して私のサーバーが動作していることをどのように確認できますか?

`/v1/document-services/ping` エンドポイントに GET リクエストを送信することで、サーバーが動作していることを確認できます。成功すれば、サーバーは`200 OK`ステータスとメッセージ`pong`で応答します。

API を使用して PDF 内の特定のテキストやパターンをどのように編集しますか?

`/v1/document-services/pdfs/redact-text` エンドポイントに、編集する PDF とテキストまたは正規表現を含む POST リクエストを送信することで、特定のテキストやパターンを編集できます。

PDF のデジタル署名が有効であるかどうかをどのように確認できますか?

PDF 内のデジタル署名を確認するには、`/v1/document-services/pdfs/verify-signatures` エンドポイントに PDF ファイルを含む POST リクエストを送信します。API は各署名の有効性に関する情報を返します。

IronSecureDoc API を使用して PDF を暗号化するにはどのような手順が必要ですか?

PDF を暗号化するには、ユーザーおよび所有者のパスワードを指定し、ページ内容の抽出やフォームの記入などの設定したい権限を含めて、PDF ファイルを `/v1/document-services/pdfs/encrypt` エンドポイントに POST リクエストとして送信します。

IronSecureDoc API を使用して PDF ドキュメントにデジタル署名する方法は?

PDF にデジタル署名を行うには、PDF ファイル、デジタル証明書、および証明書のパスワードを含む POST リクエストを `/v1/document-services/pdfs/certify` エンドポイントに送信します。

PDF ドキュメントを保護するためのオプションはどれですか?

PDF を保護するためのオプションには、ドキュメントの暗号化、アクセス権の設定、ユーザーおよび所有者のパスワードの追加、IronSecureDoc API を使用した既存のパスワードの確認が含まれます。

IronSecureDoc API を使用して PDF からテキストを抽出することは可能ですか?

はい、`/v1/document-services/pdfs/extract` エンドポイントに POST リクエストを送信することで PDF からテキストを抽出できます。特定のページまたはドキュメント全体からテキストを抽出するパラメーターを指定できます。

PDF ドキュメントのパスワードをどのように確認しますか?

パスワードを確認するには、ユーザーおよび所有者のパスワードを含む PDF ファイルを使った POST リクエストを `/v1/document-services/pdfs/verify-password` エンドポイントに送信します。これにより、それらの有効性が確認されます。

IronSecureDoc REST API の主要機能は何ですか?

IronSecureDoc REST API の主要機能には、サーバーの健全性チェック、ライセンス検証、テキストの赤字化、デジタル署名の適用、PDF の暗号化、テキストの抽出が含まれます。

Curtis Chau
テクニカルライター

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

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

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