Norwegian Signing
The signdoc/PAdES API is used in the context of PAdES electronic signing. It’s an extension of the authentication product. So through the API you can sign a PDF or a base-64 encoded document.
API documentation
1. Create a new session for the PAdES electronic signing:
POST
to
Test environment: https://test-gateway.zignsec.com/core/api/sessions/digital_signatures/bank_id_norge_pades
Production environment: https://gateway.zignsec.com/core/api/sessions/digital_signatures/bank_id_norge_pades
1.1 Request example
POST https://test-gateway.zignsec.com/core/api/sessions/digital_signatures/bank_id_norge_pades Content-Type: application/json Authorization: 12345678-YOUR-ACCESS-TOKEN-5352305c9fb0 Content-Length: 725 { "locale": "En", "metadata": { "documents": [ { "description": "My File", "end_user_only": true, "end_user_seal_position": { "page": 0, "x": 0, "y": 0 }, "file": "JVBERi0xLjcKCjEgMCBvYmogICUgZW50cnkgcG9pbnQKPDwKICAvVHlwZSAvQ2F0YWxvZwogIC9QYWdlcyAyIDAgUgo+PgplbmRvYmoKCjIgMCBvYmoKPDwKICAvVHlwZSAvUGFnZXMKICAvTWVkaWFCb3ggWyAwIDAgMjAwIDIwMCBdCiAgL0NvdW50IDEKICAvS2lkcyBbIDMgMCBSIF0KPj4KZW5kb2JqCgozIDAgb2JqCjw8CiAgL1R5cGUgL1BhZ2UKICAvUGFyZW50IDIgMCBSCiAgL1Jlc291cmNlcyA8PAogICAgL0ZvbnQgPDwKICAgICAgL0YxIDQgMCBSIAogICAgPj4KICA+PgogIC9Db250ZW50cyA1IDAgUgo+PgplbmRvYmoKCjQgMCBvYmoKPDwKICAvVHlwZSAvRm9udAogIC9TdWJ0eXBlIC9UeXBlMQogIC9CYXNlRm9udCAvVGltZXMtUm9tYW4KPj4KZW5kb2JqCgo1IDAgb2JqICAlIHBhZ2UgY29udGVudAo8PAogIC9MZW5ndGggNDQKPj4Kc3RyZWFtCkJUCjcwIDUwIFRECi9GMSAxMiBUZgooSGVsbG8sIHdvcmxkISkgVGoKRVQKZW5kc3RyZWFtCmVuZG9iagoKeHJlZgowIDYKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDEwIDAwMDAwIG4gCjAwMDAwMDAwNzkgMDAwMDAgbiAKMDAwMDAwMDE3MyAwMDAwMCBuIAowMDAwMDAwMzAxIDAwMDAwIG4gCjAwMDAwMDAzODAgMDAwMDAgbiAKdHJhaWxlcgo8PAogIC9TaXplIDYKICAvUm9vdCAxIDAgUgo+PgpzdGFydHhyZWYKNDkyCiUlRU9G", "merchant_seal_position": { "page": 0, "x": 0, "y": 0 } } ], "pades_sign_properties": { "add_visual_seals": true }, "result_content": [ "PadesSignedPdf" ], "sign_properties": { "document_display_mode": "Interior", "order_name": "My Order Name", "show_confirmation": true, "show_understanding": true, "timeout_seconds": 0 } }, "redirect_failure": "https://my_failure_url.com", "redirect_success": "https://my_success_url.com", "relay_state": "my-unique-customer-id", "webhook": "https://my_webhook_url.com" }
1.2 Request Parameters
Parameter | Description | Required |
---|---|---|
Locale | country example : En, SE etc | |
End user seal position | Page number, X and Y axis position | No |
file | PDF document or base-64 encoded document. | Yes |
Document display mode | Interior, Overlay, Window | No |
Order name | File reference name | |
Merchant seal position | Page number, X and Y axis position | No |
Result content | PadesSignedPdf, DocumentHash and PadesAppendix | No |
Add visual seals | seal visible after sign in completed if it’s true | |
Show confirmation | Show confirmation visible after sign in if it’s true | |
End user only | End user seal only visible if it’s true else end user and Bankid seal visible | |
relay_state | Optional Custom Parameter to be included in webhook calls | No |
Redirect failure | targetError works as target except it is navigated on user cancel or error situations. | No |
Redirect success | If this parameter is supplied the browser session will finally be redirected to this URL-value. | No |
webhook | A webhook in web development is a method of augmenting or altering the behavior of a web page or web application with custom callbacks | No |
1.3 Response example
{ "data": { "errors": [], "id": "03b3401d-76c7-4dbf-8099-b0d24d93d952", "redirect_url": "https://auth.current.bankid.no/auth/realms/current/precheck/auth?scope=openid+sign&sign_id=78113a7e-a21e-4c97-8775-94923bc33a3b&client_id=zignsec-current&redirect_uri=https://test-gateway.zignsec.com/integrations/redirects/v1/eid/signing/no/bankid/pades&response_type=code&state=03b3401d-76c7-4dbf-8099-b0d24d93d952&nonce=2796eecf-7a91-42e5-a54b-fce144fccdb7", "status": "SigningInProcess" } }
1.4 Response Parameters
errors | A JSON object that contains information on error conditions that might have resulted from the request, in an array of property-value pairs. If multiple errors occur, a pair of parameters is returned for each error. code Code for the error. List of codes is in table below. description A string that describes the type of error that occurred. If no errors occur, then this object is empty. errors : [] |
id | A unique session identifier generated for each workflow instance. |
redirect url | redirect url with unique session id |
status | SigningInProcess, Sign Completed, Failed |
1.4 GET session results by Session Id
https://test-gateway.zignsec.com/core/api/sessions/{{sessionId}}
https://gateway.zignsec.com/core/api/sessions/{{sessionId}}
{ "data": { "errors": [], "id": "ffbae93c-34d7-43ad-8b1a-f5f71441ad3a", "result": {}, "status": "SignCompleted", "uploadedDocuments": [ { "contentType": "application/octet-stream", "documentId": "eeea1988-f240-4a77-8d8e-32fa5f42f018", "documentOptions": { "description": "My File", "endUserOnly": true, "endUserSealPos": { "page": 0, "x": 0, "y": 0 }, "merchantSealPos": { "page": 0, "x": 0, "y": 0 } } } ] } }