Digitally Sign a Document
Use this endpoint to digitally sign a document.
Signing Service
The actual signing of the current state of the document is performed by a signing service callback that needs to be maintained and operated separately. It needs to expose a single HTTP endpoint that receives all callbacks required during the document signing flow differentiated by an action property in the request's JSON.
URL of the signing service needs to be configured via SIGNING_SERVICE_URL environment variable.
Watermark and Graphic
The appearance of a digital signature can include a watermark, which is an image typically depicting a company logo or stamp placed in the center, and a graphic, which is an image usually containing the signer's name in the form of a handwritten signature image positioned on the left side of the signature. You can find more information about these different signature appearance options at https://www.nutrient.io/guides/document-engine/signatures/signature-lifecycle/configure-digital-signature-appearance/.
To specify the image to be used as the watermark or graphic in the digital signature, send a multipart request with the application/json part containing the sign request options and the image part containing the watermark image, and the graphicImage part containing the graphic.
Request
- Base URL: http://localhost:5000
- URL: http://localhost:5000/api/documents/{documentId}/sign
- Auth: one of:
- API key in header Authorization
- HTTP bearer
Path parameters
The document ID
Headers
The PDF document password.
The value can be either a plain-text password or a base64 encoded password in a form base64:<encoded-password>. Use the Base64 encoding if your password contains characters that are not allowed in HTTP header or would be otherwise mangled (e.g. trailing or leading spaces)
If the document is password protected, any operations performed on it require supplying a password.
Request body
Example request
{
"signatureContainer": "raw",
"signatureType": "cades",
"signingToken": "user-1-with-rights",
"flatten": false,
"appearance": {
"mode": "signatureOnly",
"contentType": "image/png",
"showSigner": true,
"showReason": true,
"showLocation": true,
"showWatermark": true,
"showSignDate": true
},
"position": {
"pageIndex": 0,
"rect": [
0,
0,
100,
100
]
},
"signatureMetadata": {
"signerName": "John Appleseed",
"signatureReason": "accepted",
"signatureLocation": "Vienna"
},
"cadesLevel": "b-lt"
}Response
The newly created document digital signature.
Example response
{
"data": {
"signature": {
"signerName": "John Appleseed",
"creationDate": "2013-12-19 14:45:26",
"signatureReason": "accepted",
"signatureLocation": "Vienna",
"validFrom": "2023-12-01T15:34:15Z",
"validUntil": "2025-11-30T15:34:14Z",
"signatureFormFQN": "Signature-a9c0376e-15cd-416f-9b8f-bbf341fae0ca",
"signingCertificateChain": [
{
"issuerCommonName": "Example CA",
"serialNumberHex": "1234567890ABCDEF",
"subjectCommonName": "John Appleseed",
"validFrom": "2023-12-01T15:34:15Z",
"validUntil": "2025-11-30T15:34:14Z"
}
]
}
}
}Changes
No recorded changes to this operation across all 1 revision of this API.