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.
1. Try it without code
See what your users will experience:
- Open the signing playground and click Try a sample PDF, or drop in your own file.
- Under Signing setup, select eID Easy signing page as the signing flow and PDF as the output format.
- Click Continue to signing.
- On the signing page, click Sign, choose Estonia β Smart-ID, and enter the test code
40404049996. It approves automatically. - 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.
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}}"
}
]
}'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.
4. Download the 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}}"
}'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: