Sign a Document

Have a user sign a PDF on the hosted eID Easy signing page, then download the signed file. This takes two API calls.

β–Ά This quickstart is interactive. Click Send request in each step to call the test environment with the shared sandbox credentials. Values from each response, such as IDs and codes, are filled into the next request automatically.
client_id 2IaeiZXbcKzlP1KvjZH9ghty2IJKM8Lgsecret 56RkLgZREDi1H0HZAvzOSAVlxu1Flx41

1. Try it without code

See what your users will experience:

  1. Open the signing playgroundopen in new window and click Try a sample PDF, or drop in your own file.
  2. Under Signing setup, select eID Easy signing page as the signing flow and PDF as the output format.
  3. Click Continue to signing.
  4. On the signing page, click Sign, choose Estonia β†’ Smart-ID, and enter the test code 40404049996. It approves automatically.
  5. You return to the playground, where you can download the signed PDF.

The playground also shows the API requests behind each setting, and lets you try other flows such as the embedded widget, digest signing, and multiple signers.

2. Prepare the file for signing

Your server uploads the file and gets back a doc_id and a link to the signing page. signature_redirect is where the user returns after signing; here, it's this page.

πŸ“„ File to sign: Loading the sample PDF…
POSThttps://test.eideasy.com/api/signatures/prepare-files-for-signing
curl -X POST https://test.eideasy.com/api/signatures/prepare-files-for-signing \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "2IaeiZXbcKzlP1KvjZH9ghty2IJKM8Lg",
    "secret": "56RkLgZREDi1H0HZAvzOSAVlxu1Flx41",
    "container_type": "pdf",
    "signature_redirect": "{{redirect_uri}}?qs_return=signed",
    "files": [
      {
        "fileName": "{{file_name}}",
        "mimeType": "application/pdf",
        "fileContent": "{{file_b64}}"
      }
    ]
  }'
Complete the previous step first. This request needs file_b64.

The doc_id expires in 14 days, so in production prepare files just before the user signs.

3. Sign

Send the user to signing_page_url. Click Sign, choose Estonia β†’ Smart-ID, and enter 40404049996. Need another method? See Test Identities.

Complete the previous step first to get signing_page_url.

4. Download the signed file

POSThttps://test.eideasy.com/api/signatures/download-signed-file
curl -X POST https://test.eideasy.com/api/signatures/download-signed-file \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "2IaeiZXbcKzlP1KvjZH9ghty2IJKM8Lg",
    "secret": "56RkLgZREDi1H0HZAvzOSAVlxu1Flx41",
    "doc_id": "{{doc_id}}"
  }'
Complete the previous step first. This request needs doc_id.

The response contains signed_file_contents, the base64-encoded signed PDF. πŸŽ‰ If you get "does not have any signed files", complete Step 3 first.

In production, wait for the webhook

Instead of downloading right away, configure the Document signed webhook and download the file when it arrives. Make these requests from your server, since they include your secret.

Go live

  • Follow the shared go-live steps.
  • Configure the webhook URL and enabled signing methods in the live admin panel.
  • Check the method pages for methods that need extra onboarding before production use.

Next steps

You used the hosted signing page, the simplest option. Choose how much of the experience you want to own:

Last Updated: