API¶
Create Signing¶
eSign has a simple API to be able to programmatically create signings. It's available both as a Python module and as REST.
Use the signing method option keys when setting the signing method(s).
Python¶
from limepkg_esign.api import EsignSigning
# Create signing based on document ids.
# Passing the language as third parameter is optional,
# otherwise default language is used.
signing = EsignSigning(app, [7458])
# At least one signer is required.
# Signers will be on order=1 as default.
signing.add_signer("Katja", "[email protected]")
# This signer is on second and linked to a parent limeobject.
signing.add_signer("Joelito", "[email protected]", 2, "person", 3001)
# At least one signing method is required
signing.add_method("bankid_se")
signing.add_method("checkbox")
# The signing properties will be prefilled, exactly as in the web client.
# Can be overriden as shown below.
signing.title = "Sign this this document, or else..."
signing.language = "da"
signing.message = "...you're in for a big surprise."
# More documents can be added
signing.add_document(6129)
# Save and start the signing process by creating the signing.
# It will be created using checkpoints, just as every other signing.
signing_id = signing.create()
REST¶
The REST API is using the Python API module internally. Parameters are the same, but camel cased.
Post JSON to limepkg-esign/api/signing/
with appropriate authentication headers.
Will return the id
of the created signing if succesful.
{
"language": "da",
"title": "Sign this this document, or else...",
"message": "...you're in for a big surprise.",
"documentIds": [
7458, 6129
],
"methods": [
"bankid_se",
"checkbox"
],
"signers": [
{
"name": "Katja",
"email": "[email protected]"
},
{
"name": "Joelito",
"email": "[email protected]",
"limetype": "person",
"id": 3001,
"order": 2
},
]
}