Signature API
The Signature API creates and follows signing orders from your own system. It does what the Digital Signing Creator and Orders do in the application: send PDF files to signers, read the status, remind, stop and delete orders, and download the result.
The API runs on api.digitalsigning.metaforce.net. This page describes the calls, the fields you send and the responses you get back.
Authentication
Use an API client and a bearer token, as described in Authentication. Your company needs a Signature licence, or every call is refused.
Create an order
Send a POST to /DigitalSigningOrders with a JSON body:
curl -X POST "https://api.digitalsigning.metaforce.net/DigitalSigningOrders" \
-H "Authorization: Bearer <access token>" \
-H "Content-Type: application/json" \
-d '{
"packageName": "Service agreement",
"language": "en",
"useSignatureOrder": false,
"distributeSignedDocumentToAllSignatories": true,
"signingOrderFiles": [
{ "name": "Service agreement.pdf", "fileContent": "<PDF file as base64>" }
],
"signatories": [
{ "emailAddress": "kari.nordmann@example.com", "signingSequence": 2 }
],
"signingNotificationTitle": "Document to be signed - [DOCUMENTNAME]",
"signingNotificationMessage": "Please sign the agreement.",
"emailNotificationSubject": "Document to be signed - [DOCUMENTNAME]",
"emailNotificationMessage": "Please sign here: [SIGN-URL]"
}'
| Field | Meaning |
|---|---|
packageName | The name of the order. Required. |
signingOrderFiles | The PDF files, each with name and fileContent as base64. Required, 1 to 10 files, PDF only. |
signatories | The signers. At least one. Each has emailAddress and signingSequence. |
language | The language of the signing page. Required. One of cs, da, de, el, en, es, et, fi, fr, hu, is, it, lt, lv, nb, nl, pl, pt, sv. |
useSignatureOrder | true to use the signing order. See below. |
distributeSignedDocumentToAllSignatories | true to e-mail the signed PDF to all signers when done. Signicat only. |
signingNotificationTitle, signingNotificationMessage | The text shown on the signing page. Up to 256 and 8000 characters. |
emailNotificationSubject, emailNotificationMessage | The e-mail that asks for the signature. Up to 256 and 8000 characters. Use [SIGN-URL] for the link and [DOCUMENTNAME] for the name. |
archiveFolderId | The archive folder for the signed PDF, when your company stores signed files. |
completedWebhookUrl, cancelledWebhookUrl | Addresses to call when the order is completed or stopped. See Webhooks. |
The title, message and subject fields are required, and they follow the same rules as in the application. See Create a signing order.
Each signer takes these fields:
| Field | Meaning |
|---|---|
emailAddress | Required |
signingSequence | 0 Initial, 1 Depends on initial, 2 No order. Send 2 unless useSignatureOrder is true. With 1, give at least one other signer 0. The API does not check this for you. |
firstName, lastName | Required when your provider is Verified or Scrive |
signatureAuthorizationChoosenMethod | standard, no_bankid or se_bankid, when your provider offers the choice |
id | Optional. Letters, digits, - and _, up to 64 characters. |
signViaUrl | Scrive only. Set it to true to get this signer’s signing link back in the response instead of having Scrive e-mail it. Pass the link on to the signer yourself. |
The response
A successful call returns 200 with the order in data and type set to 0:
{ "data": { "id": "<order id>" }, "type": 0, "message": null }Keep the id. Every other call uses it. The order in data also lists the signers in signatories, each with signUrl, the personal link that opens the signing page. With Scrive, signUrl is filled in only for signers sent with signViaUrl. Save the links you need from this response: GET /{id} does not return them. When the provider or the licence stops the order, the call still returns 200, but type is 1 (failure) or 2 (warning) and message says why:
message | Meaning |
|---|---|
licence_order_will_exceed_usage | Files times signers is more than your remaining licence |
license_usage_limit_reached | The licence for the period is used up |
license_invalid | No valid Signature licence |
something_went_wrong_with_external_provider | The provider did not accept the order |
invalid_personal_number | The provider needs a personal number for a signer, for example for a BankID sign method. Use standard for that signer. |
something_went_wrong_internal | Signature could not save the order, or a name that the provider needs was missing |
A body that breaks a rule, such as more than 10 files or a missing subject, returns 400 with the field and the reason.
Follow and act on orders
All paths start at https://api.digitalsigning.metaforce.net/DigitalSigningOrders.
| Call | What it does |
|---|---|
POST /GetListOfOrders | Lists the 200 most recently changed orders that were created between fromDate and toDate. The body can also hold isShowMyFieldOnly, sortBy (a field name such as PackageName or UpdatedDate) and sortDesc. |
GET /{id} | One order with its files and signers. |
GET /GetCreateOrderInitialData/{langCode} | The data the creator starts from, in the language langCode (for example en): the standard e-mail and signing texts, the provider, whether a new order can be created, the archive folders you can choose from and the supported languages. |
GET /SendReminders/{id} | Sends a reminder to each signer who has not signed. |
DELETE /{id} | Stops the order. Returns true when it was stopped. |
DELETE /DeleteOrder/{id} | Deletes the order. An order that has not been stopped is stopped first. |
GET /GetCertifiedPdf/{id} | The signed PDF, when it is stored in the archive. |
GET /GetAllSignatureFiles/{id} | A ZIP file with the signature XML files of all signers. |
GET /GetSignatureFile/{id}/{signerId} | A ZIP file with the signature XML files of one signer. |
GET /GetPdfFromProvider/{id} | The signed PDF from the provider, for completed orders. |
GET /Activities is at https://api.digitalsigning.metaforce.net/Activities and returns the five most recently changed orders of your company, the same as Your latest activity in the application. Each item has id, packageName, totalSignatories, signedSignatories, numOfDocuments, status (the same values as orderStatus below) and updatedDate.
The list does not filter by status or e-mail address on the server. Read the list and filter it in your system.
What an order looks like
GET /{id} and the items of POST /GetListOfOrders describe an order with these fields:
| Field | Meaning |
|---|---|
id | The order id |
packageName | The name of the order |
orderStatus | The status of the order. See Status values. |
providerType | The provider: 1 Signicat, 2 Verified, 3 Scrive |
createdBy | The e-mail address of the user who created the order |
updatedDate | When the order was last changed |
signatories | The signers |
Each signer in signatories has id, emailAddress, signingSequence and signStatus.
Status values
An order has an orderStatus number:
| Value | Status |
|---|---|
1 | Created |
5 | In Progress |
10 | Completed |
20 | Completed, and the signed PDF is stored in the archive |
50 | Rejected |
70 | Canceled |
99 | Error |
Each signer has a signStatus: 0 Not Set, 1 Created, 2 Started, 3 Completed, 4 Rejected, 5 Expired, 6 Forwarded, 7 Canceled.
Webhooks
Set completedWebhookUrl and cancelledWebhookUrl when you create the order to learn about the end of an order without polling. When the order is completed or stopped, Signature sends a GET request to the matching address. The request has no body, so put something in the address that tells you which order it is, for example https://example.com/signing-done?order=agreement-42. If the address cannot be reached, Signature tries again a few times. Then read the order with GET /{id} for the details.