Skip to content

  • Documentation
    • OKdokument API
    • SIGNATUS User Manual
  • Contact Us

1. API concept

  • Overview
  • 1.1 Supported web browsers
  • 1.2 Supported languages
  • 1.3 How to prepare document for signature
  • 1.4 How to use acrofields
  • 1.5 How to use pre-defined signature fields
  • 1.6 Document states
  • 1.7 Storing and deleting documents
  • 1.8 OKDokument API call list
  • 1.9 QR code
  • 1.10 Email and SMS
  • 1.11 Dictionary

2. Core API services

  • 2.1 Authorization
  • 2.2 Create signature request
  • 2.3 Open document
  • 2.4 Information about signing completion
  • 2.5 Result URL
  • 2.6 Download document
  • 2.7 Delete document

3. Additional API services

  • 3.1 List of the documents
  • 3.2 Document Info
  • 3.3 Update Signature Request ID
  • 3.4 Delete Signature Request ID
  • 3.5 Signature request Counter
  • 3.6 Upload document

4. Use cases

  • Overview
  • 4.1 Example 1: Simple one-round signing
  • 4.2 Example 2: One-round signing with redirect url
  • 4.3 Example 3: One-round signing with send info
  • 4.4 Example 4: Multi-Round Signing

5. Configuration of the signing process

  • Overview
  • 5.1 One-round signing with simple PDF
  • 5.2 Multi-round signing with simple PDF
  • 5.3  One-round signing with PDF with tags
  • 5.4 Multi-round signing with PDF with tags
  • 5.5 One-round signing with PDF with signature acrofields
  • 5.6 Multi-round signing with PDF with signature acrofields
  • 5.7 Accessing document after inserting OTP
  • 5.8 Sign document with OTP
  • 5.9 Email
  • 5.10 QR code
View Categories
  • Home
  • Documentation
  • OKdokument API
  • 2. Core API services
  • 2.2 Create signature request

2.2 Create signature request

Create signature Request is the most important API Service, that allows the uploaded document to be signed and register new signing request together with definition signing process parameters.

Create signature Request can be used in following cases (more details can be found in chapter 4 Use cases):

  1. Upload new document (content of the document in base 64 format) in case of the first round of signing
  2. Link to document ID in case of other rounds of signing

Service specifications:

URLhttps://apidev.okdokument.com/JSON/signatureRequest
MethodPOST
AuthenticationAuthentication set header x-api-key
Content Typeapplication/json
Request bodydata in JSON format – see table below  
ResponseHTTP status 200 when successful

Example for the upload of a new document:

{
    "resulturl": "https://okdokument.com",
    "filedata": {
        "content": "xyz_JVBERi0xLjc=="
    }
}

Example of an existing document:

{
    "resulturl": "https://okdokument.com",
    "id": "y7Ki_u1mrUwijfb-o_S1JiphSsoXya8iypH380F",
    "allowedFields": {
        "SIGNATURE": "_SO1_"
    }
}
KeyFormatRequiredDefault valueDescription
resulturlStringNoOKdokument ThankYou pageURL to redirect the browser after finishing the signing process
filedataJSON ObjectYes, if document upload is need JSON Object of PDF file
filenameStringNo Name of the document. This parameter is mandatory if you want to do the file conversion to PDF format. For conversion the file postfix must be: contract.doccontract.docxcontract.xlscontract.xlsx Name of the document with PDF postfix is also used in the email template.
contentbase64 StringYes The binary content of the uploaded PDF file in base64 format. https://base64.guru/converter/encode/file Maximal document size is 10 MB Parameter content can be also called with $content.
stateStringNotosignThe state of the document: tosign – document ready for signingtags – pre-processing document, searching for tags and inserting signature acrofields. After inserting signature acrofields, document changes state to tosign.tostamp – pre-processing document, inserts digital stamp into document
sendInfoURLStringNo Info service provider by Portal application used for backed to backed communication after the document is submitted as signed or cancelled.
allowedFieldsJSON ARRAYNo[]Defines acrofields that are allowed in document “allowedFields” : {“SIGNATURE” : “_SO1_”}
changeStateStringNo Used to change state after finishing the round of signing: tosign
idStringYes, if document is preloaded Preloaded document id, used in the second round of signing, when the document is already in OKdokument temporary storage. When parameter id is filled, parameter filedata must be empty.
rulesStringNo All rules are described in the table below  
sigDataJSON objectNo{}Parameter for storing secret information into encrypted part of signature directly in PDF structure. “sigData” : {“systemId”:“1234567″, “email”:”johnsmith@gmail.com”}

Example of combigning rules:

{
  "rules": {
    "guiSignerName": "John Smith",
    "guiRequestSignerName": false,
    "signAnywhereEnabled": false
  }
}
Rule nameParameterDescription
signAnywhereEnabledfalseParameter for disabling sign anywhere function
guiRequestSignerNametrueParameter for enabling the input for signer name
guiSignerNameSigner namePredefined value for signer name, max 40 characters. If guiRequestSignerName is enabled, signer name can by changed by signer
emailToSigner emailSigners’ email to which signature Request url will be delivered.
emailFromSender emailSenders’ email. Mandatory if emailTo rule is used
nameFromSender nameSenders’ name, that will be used in the email templates
emailNotification Rule that enables email reminder. Email reminder sends email every morning at 7:00 for signature requests that are not signed. The email is sent to emailTo and emailFrom – according to signatureRequest configuration.
emailFinalSigner emailEmail to deliver the signed document. If emailFinal is without parameter, the signed document will be sent to emailTo.
openOtpPhoneSigner phoneSigners’ phone number to which the one-time password for accessing the document will be delivered. International phone format is required. Allowed country prefixes are: +43, +32, +359, +357, +420, +49, +45, +372, +34, +358, +33, +30, +385, +36, +353, +39, +371, +352, +370, +356, +31, +48, +351, +40, +46, +386, +421, +380 Assumption: to use SMS OTP, you must buy signature Request package with SMS. Per signatureReuqest only 3 OTP codes can be sent. After that signatureReuqest is blocked and new one must be created. Signer has 3 attempts to insert correct OTP, after that OTP is blocked and new OTP must be sent.
openOtpEmailSigner emailSigners email to which the one-time password for accessing the document will be delivered. Per signatureReuqest only 3 OTP codes can be sent. After that signatureReuqest is blocked and new one must be created. Signer has 3 attempts to insert correct OTP, after that OTP is blocked and new OTP must be sent.
signOtpPhoneSigner phoneSigners’ phone number to which the one-time password for signing the document will be delivered. OTP signature requires signature acrofield. International phone format is required. Allowed country prefixes are: +43, +32, +359, +357, +420, +49, +45, +372, +34, +358, +33, +30, +385, +36, +353, +39, +371, +352, +370, +356, +31, +48, +351, +40, +46, +386, +421, +380 Assumption: to use SMS OTP, you must buy signature Request package with SMS. Per signatureReuqest only 3 OTP codes can be sent. After that signatureReuqest is blocked and new one must be created. Signer has 3 attempts to insert correct OTP, after that OTP is blocked and new OTP must be sent.
signOtpEmailSigner emailSigners email to which the one-time password for signing the document will be delivered. OTP signature requires signature acrofield. Per signatureReuqest only 3 OTP codes can be sent. After that signatureReuqest is blocked and new one must be created. Signer has 3 attempts to insert correct OTP, after that OTP is blocked and new OTP must be sent.
langsk, cs, en, ro, uk, pl, pt, huLanguage of email and SMS template: sk – Slovakcs – Czechen – Englishpl – Polishro – Romanianuk – Ukrainianpt – Portuguesehu – Hungarian If the rule is not set, Slovak as a default language is used.
mouseSignaturefalseRule for disabling signing with the mouse.
otpCodenumberPredefined code used in combination with openOtp
guiOpenSignaturetrueAutomatically opens the signature field when the document is loaded
guiAutoSubmittrueAutomatically submits the document after the signing is completed

Create signature Request has also some additional data that are used in the process of signing:

KeyFormatRequiredDefault valueDescription
signatureRequestIdStringNoGUIDRandom unique value
stateStringNotosign;canceledtosign – sigigning only available where document is in state tosigntosign, cancelled – signing is available also in state cancelled (when signer closes the document, the document can be opened again and signed)signed – used when stamping document (state to stamp in signatureRequest). After stamping document, document changes state to signed
expirationTimeLongNoactual time + 24 hourssignature Request ID expiration time. Time in Milliseconds since Jan 1, 1970 00:00:00 UTC
fieldConfigJSON ARRAYNo Array of JSON object that describe, how the value will be set to acrofields, and set read only option
nameStringYes Name of the acrofield
valueStringYes Acrofield value
readOnlyBooleanNofalseIf true, acrofield value cannot be change during the signing process. If change is forced in browser value from signatureRequest will be used

Use of all parameters can be found in the  5 Configuration of the signing process.

Success response example

{
    "message": "msg.signature.request.id.created",
    "result": "1d58a59e-e8f7-4d07-bb99-d3fa39cb58a8"    "url": "https://apidev.okdokument.com/openDocument/1d58a59e-e8f7-4d07-bb99-d3fa39cb58a8",
    "documentId": "y7Ki_u1mrUwijfb-o_S1JiphSsoXya8iypH380F"}

When a request is made, OKDokument API Server validates the content of the data parameter request. When a problem is detected, it returns the status of HTTP 400/500 and a report of the problem found in the body of the response in JSON format.

Error response Body Example:

{    "message": "err.json.syntax"}

Or

{    "message": "err.missing.required",
    "result": "1d58a59e-e8f7-4d07-bb99-d3fa39cb58a8"}

Data parameter validation description:

Parameter nameValidation descriptionMessage
stateAllowed rangeerr.signature.request.state
idRequired attributeerr.missing.required.attribute
idDocumenterr.signature.request.documentid
idDocument stateerr.invalid.document.state
resulturlFormaterr.signature.request.resulturl
expirationTimeFormaterr.signature.request.expirationTime.format
expirationTimeAllowed rangeerr.signature.request.expirationTime
fieldsBeforeSigningAllowed rangeerr.signature.request.fieldsBeforeSigning
fieldConfigFormaterr.signature.request.fieldConfig
Updated on 31/03/2025
2.1 Authorization2.3 Open document
  • Documentation
    • OKdokument API
    • SIGNATUS User Manual
  • Contact Us
Proudly powered by WordPress