There are 3 ways to prepare a file for signing:

  • Prepare a template on eID Easy (no-code)
  • Upload a file for signing
  • Add signature to an existing container

Prepare a template on eID Easy (no-code)

If your needs are simple, you can have eID Easy prepare the file for you. For this, you must define a template on id.eideasy.com.

A template might look something like this:

I, !!Firstname!! !!Lastname!!, hereby declareth that it was not I who ate the cake. For further inquiries, you can reach me on !!Phone!!.

After creating the template, you’ll get a contract_id. Make note of it, you will need it later.

Unless you fill the fields via API, the user will be able to fill the fields. To fill the fields via API, make a POST request to https://id.eideasy.com/api/signatures/prefill-form-fields, with this body structure:

{
  "tag_values": {
    "Firstname": "Toomas",
    "Lastname": "Ilves"
  },
  "tag_defaults": {
    "Phone": "+37255529332"
  },
  "client_id":"j9FXBpH0SMfipcDoArwxbq8ipF7xqiex",
  "secret":"j9FXBpH0SMfipcDoArwxbq8ipF7xqiex"
}

Use tag_values to pre-fill fields and lock them in. Use tag_defaults to pre-fill fields but allow the user to change them before signing.

Example response: 

{
  "status":"OK",
  "code":"rawaQxqrlYrsaGvslt7JFFCcMYztXHHwedFMPbze"
}

Make note of the code. You will need it when directing the user to sign the document!

Upload a file for signing

It’s entirely possible that our simple templating solution does meet your specific needs. In this case, you can generate the file on your own server, and upload it to eID Easy for signing.

First, make a POST request to https://id.eideasy.com/api/signatures/prepare-files-for-signing. Request must include file_content in base64 encoding. Example:

{
  "filename":"my_doc_to_be_digned.pdf",
  "file_content":"UEsDBBQAAAgAAHI6z06KIflFHwAA",
  "client_id":"j9FXBpH0SMfipcDoArwxbq8ipF7xqiex",
  "secret":"j9FXBpH0SMfipcDoArwxbq8ipF7xqiex"
}

Example response: 

{
  "status":"OK",
  "doc_id":"rawaQxqrlYrsaGvslt7JFFCcMYztXHHwedFMPbze"
}

Make note of the doc_id. You will need it when directing the user to sign the document!

Add signature to an existing container

If you need to collect someone’s signature on a container that’s already been signed, you must base64-encode your bdoc or asice file. Send a POST request to https://id.eideasy.com/api/signatures/prepare-add-signature, with the following parameters in its JSON body:

client_idREQUIRED. Your website’s client_id, as shown in the id.eideasy.com portal.
secretREQUIRED. Your website’s secret, as shown in the id.eideasy.com portal.
filenameREQUIRED. What should the container be called? E.g my_signed_doc.asice
containerREQUIRED. The container to be signed, in base64-encoding

Example response: 

{
  "status":"OK",
  "doc_id":"rawaQxqrlYrsaGvslt7JFFCcMYztXHHwedFMPbze"
}

Make note of the doc_id. You will need it when directing the user to sign the document!