NGSign WS v2.20 1.0
NGSign WS v2.20 1.0
NG TECHNOLOGIES
Building Trust with Next Generation Technologies
NGSign
Web Services Specifications
Identifier NGSIGN-WS
Product Version NGSign 2.20
Document Version 1.0
Description NGSign Web Services documentation.
Diffusion Internal / Clients (API Only)
© NG Technologies 2022
www.ng-sign.com
[email protected]
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 2/49
Change history
3
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 4/49
INDEX
1. INTRODUCTION 8
2. OPERATIONS 8
7.1. NGUSER 23
7.2. NGSIGNER 23
7.3. NGFILEUPLOAD 23
7.4. NGTRANSACTION 24
7.5. NGSIGNERCONFIGURATION 26
7.6. NGSIGNATURECONFIGURATION 26
7.7. NGDOCUMENT 27
7.8. NGDOCUMENTCONFIG 28
7.9. NGREDIRECTIONURL 28
7.10. VALUESWRAPPER 28
7.11. NGINVOICEUPLOAD 28
7.12. INVOICECONFIGURATION 29
7.13. TEIFINVOICE 29
7.14. PARTNERDETAILS 30
7.15. INVOICEITEM 30
7.16. NGINVOICE 31
7.17. CERTIFICATERESPONSE 31
7.18. ENUMERATIONS 32
7.18.1. USERS STATUS 32
7.18.2. TRANSACTIONS STATUS 32
7.18.3. SIGNATURE MODES 32
7.18.4. SIGNATURE TYPES 33
7.18.5. OTP MODES 33
7.18.6. MAIL RECEIVER MODES 33
7.18.7. INVOICE STATUS 33
8. ERROR CODES 34
9. EXAMPLES 35
6
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 7/49
FIGURES
7
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 8/49
1. INTRODUCTION
NGSign is a complete electronic signature platform. It offers a quick and easy way to sign
and have PDF documents signed electronically using various types of certificates.
This document presents NGSign API to create and configure signature transactions.
2. OPERATIONS
NGSign API allows to create signature transactions to sign and to have signed PDF
documents. The core service of NGSign is creating and configuring a transaction. A
transaction includes one (or more) document to sign, its creator ("creator"), signatories and
several configurations per signer and per document.
NGSign API allows as well to create signature transactions to sign and to have signed XML
documents. XML Signatures uses similar web services as below for PDF, except that all web
services are prefixed with “/xml”.
The simplest way to create a signature transaction with NGSign is to make a complete global
configuration (documents, signatories ...) and then launch the transaction (see Creating a
complete transaction below).
NGSign supports an advanced mode: create an incomplete transaction and complete the
configuration later (see Creating a transaction with incomplete configurations). For example,
this mode is useful when the creator of the transaction does not have the necessary
information for all the signers when creating the transaction. Missing information may be
completed later depending on the target workflow.
Prior to any WS call, a authentication token must be generated from the NGSign caller
account (see Using bearer token). This token, must be used in all WS calls (see the examples
at the end of the document).
Creating a signature transaction with NGSign requires the following steps and web services:
8
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 9/49
The first step is to upload the PDF documents to be signed. The next step is to configure the
transaction and launch the electronic signature. Depending on the signature mode of the first
signer (see Signature modes), an email invitation may be sent to the first signer or the creator
redirects the first signer to the Signature Page.
In this case, the signature transaction is created with at least two signers and the configuration
is incomplete for at least the second signer. The missing configuration can be given later. As
long as the configuration is not completed, the signer cannot access to the signature page.
Each time the configuration of a signer is completed, NGSign will try to continue the
transaction (e.g by sending the invitation email if the next signer has BY_MAIL mode).
NGSign Signature Page is the web page to which each person invited to sign is redirected. It
implements a secured signing area.
• Signer identification: the first name and last name of the signer are explicitly
displayed. The signer must verify their accuracy before signing.
• View of the entire document: before signing, the signer must read all the pages of
the PDF document to be signed.
• Collection of the signer's consent: the signer must explicitly indicate his agreement
for the content of the document before signing;
• Electronic signature: depending on the type of signature (token, time stamp with a
One Time Password, remote certificate on a Hardware Security Module), the signer is
invited to activate his electronic signature.
10
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 11/49
11
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 12/49
NGSign supports two redirection modes for the electronic signature page:
1 Face to Face signature: the signer is redirected to the signature page directly after the
creation of the transaction (e.g if the creator is also the first signer);
2 By link: the client application must redirect the signer to the signature page
3 Signature on invitation by email: the signer receives an email with an invitation link
for signature. The link redirects the signer to the signature page.
In the first case, the creation of the redirect URL and the redirection is the responsibility of
the calling platform.
https://{server}/pds/#/transaction/sign/{nextSigner}?uuid={transactionUuid}
Note: The Signature Page URL has been changed since version 2.9. The old URL
(https://{server}/web/transaction/sign/{nextSigner}) is still working but may be disabled in
the coming versions.
12
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 13/49
After signing, the signer is redirected to a default landing page configured at the server level.
The landing page can be configured using one of the following ways:
To redirect the signer to a specific page, an "url" parameter can be added when redirecting the
signer to the signature page.
https://{server}/pds/#/transaction/sign/{signerUuid}?url=specificURL
URL
The caller can add additional information to specificURL for processing on the landing page.
Typically, the caller can put the transaction ID. When redirecting to the "specificURL" page,
the caller can make a call on NGSign with the transaction identifier to retrieve the final status
of the transaction Retrieving transaction information and the signed document Retrieving a
signed document.
Since NGSign 2.9, it is possible to configure landing pages for each signer using
NGSignerConfiguration. Using this option, you can configure a successURL and a
failureURl using the API when creating the transaction.
NGSign supports several signature types (see Signature Types). The signature type is related
to the signature level and signing certificate type.
The signature type must be configured when creating the signature transaction. It is possible
to set “LATER” at this stage. In this case, the signer will be asked to choose a signature type
in the Signature Page.
13
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 14/49
NGSign implements electronic invoice signing using the invoice format (TIEF) and protocols
specified by TTN (Tunisia Trade Net).
An Invoice signing module is available for NGSign users with the Organization option. If
this module is enabled, an “Invoice” menu is available from the dashboard:
14
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 15/49
All NGSign web services expect to receive POST or GET requests with JSON encoding for
parameters. The results are returned in JSON.
For each call, the server returns a response with one of the following two HTTP statuses:
• 200: the request has been executed successfully. The client must manage the
payload of the response;
• 400: problem in the request or server error. The response contains a code and a
detailed error message.
Some calls to the server require to be authenticated beforehand; other calls can be made
without authentication:
• URLs preceded with "/ protected" require prior authentication; For these requests,
the header must include a “Cookie” with JSESSIONID returned by the
authentication call.
• The other URLs can be called without authentication.
3.2. Authentication
To access any /protected web services without a previous authentication and cookie. The user
must have a JWT previously generated from the web interface (NGSign Web App) then use
the generated token as a Bearer authorization token. See Examples.
16
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 17/49
The purpose of this web service is to check if a person has a Digigo or NGCert certificate.
To create a transaction, you must send the list of PDF files to sign in Base64 format.
The call is made using the unique transaction identifier (transactionUuid) retrieved when
PDF files are loaded.
To place the visual stamps manually while using the API for all other configuration (mixed
mode configuration), the caller must invoke a specific web service then access the front page
that will allow placing the visible stamps manually.
The users are then invited to sign the document normally as in the standard workflow.
A GET call with the transaction unique identifier (transactionUuid) can be used to get the
current information and status of the given transaction.
This is a document specific web service. It can only apply on the documents with the flag
“withQrSecure” set to true when the document is first uploaded.
19
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 20/49
To retrieve the signed file in binary form (PDF document), the transaction identifier
(transactionUuid) and the unique identifier of the file (documentUuid) must be used. The
document identifier can be retrieved from the NGTransaction object.
The information (from NGSignerConfiguration) that can be omitted for some signers are:
• firstName;
• lastName;
• phoneNumber;
• email.
In the case some information have been omitted when configuration a signature transaction,
the configuration must be completed before redirecting the signer to the Signature Page.
20
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 21/49
To create a transaction, you must send the list of PDF files to sign in Base64 format.
The call is made using the unique transaction identifier (transactionUuid) retrieved when
XML files are loaded.
A GET call with the transaction unique identifier (transactionUuid) can be used to get the
current information and status of the given transaction.
To retrieve the signed file in binary form (PDF document), the transaction identifier
(transactionUuid) and the unique identifier of the file (documentUuid) must be used. The
document identifier can be retrieved from the NGTransaction object.
21
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 22/49
Use this web service to send invoice data to NGSign. The invoice will be available from
NGSign dashboard to validate and sign.
Since 2.17
Use this web service to check the status of an invoice. The web service uses the unique
identifier (uuid) returned by the prepare call above.
Use this web service to download the invoice PDF file. The web service uses the unique
identifier (uuid) returned by the prepare call above.
22
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 23/49
This section lists all JSON objects used in the Rest API.
7.1. NGUser
7.2. NGSigner
7.3. NGFileUpload
23
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 24/49
Indique si un QR Secure
peut être ajouté au
document
7.4. NGTransaction
25
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 26/49
7.5. NGSignerConfiguration
• “OTP” to
“NONE” for.
7.6. NGSignatureConfiguration
26
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 27/49
7.7. NGDocument
27
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 28/49
7.8. NGDocumentConfig
7.9. NGRedirectionUrl
Since 2.9.
Value Description
successUrl URL where signer will be redirected after acting signature
successfully.
failureUrl URL where signer will be redirected after acting signature
failure
7.10. ValuesWrapper
Since 2.14
Value Description
values An array of values to be inserted in the QRSecure.
7.11. NGInvoiceUpload
28
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 29/49
Since 2.17
7.12. InvoiceConfiguration
Since 2.17
7.13. TEIFInvoice
Since 2.17
29
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 30/49
invoiceTotalWithTax float
invoiceTotalTax float
invoiceTotalinLetters String
stampTax float
tvaRate float
tvaTax float
totalDiscount float
7.14. PartnerDetails
Since 2.17
7.15. InvoiceItem
30
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 31/49
Since 2.17
7.16. NGInvoice
Since 2.17
7.17. CertificateResponse
Since 2.18.
31
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 32/49
7.18. Enumerations
Value Description
TEMPORARY_CREATED User created but not yet activated.
CREATED User created and activated.
DELETED User deleted.
SUSPENDED User suspended.
BY_MAIL The signer will receive an email with the signature 2.8
invitation link.
BY_LINK The redirection to the Signature Page is the total 2.9
responsibility of the API called. He must create the
URL redirection to the Signature Page and redirect
the signer.
AUTOMATIC No manual approval. The signature (timestamp) will 2.8
be automatically applied on the document.
Document viewing and approval must be done out
of the scope of NGSign.
Value Description
OTP Request the signer to enter an OTP code received by SMS
before signing.
NONE No SMS validation
Value Description
RECEIVER The signer will receive the email of the corresponding event.
NONE The signer will not receive any email.
Value Description
33
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 34/49
8. ERROR CODES
Error code Valu Description
e
MISSING_PDF_ERROR 101 A PDF is missing for the
transaction.
TRANSACTION_NOT_FOUND_ERROR 102 This transaction does not
exist.
TRANSACTION_USER_NOT_FOUND_ERROR 103 The user referenced in the
transaction does not exist.
INVALID_OTP_ERROR 104 The OTP is invalid.
TRANSACTION_SIGNED_ERROR 105 This transaction is already
signed.
TRANSACTION_CANCELLED_ERROR 106 This transaction is
cancelled.
NO_MORE_TOKENS_ERROR 107 The creator is not allowed
to create more transactions
(no tokens)
TIME_STAMPING_ERROR 108 Timestamping failed (may
happen if the signature
mode is
“CERTIFIED_TIMESTA
MP”.
ONLY_CREATOR_CANCEL_TRANSACTION_ 109 An error occurred when a
ERROR user which is not the
creator try to cancel
transaction.
INVALID_PAGE_NUMBER_ERROR 110 The given page number is
invalid (out of range)
OTP_SEND_ERROR 112 An error occurred when
trying to send the OTP
code.
INVALID_CONFIGURATION 113 Invalid configuration. The
transaction remains in the
status “CREATED”
USER_IS_NOT_CREATOR_ERROR 114 The user is not the creator
34
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 35/49
of the transaction
TRNASACTION_CONFIGURED_ERROR 119 The transaction is already
configured
MAIL_FILE_NOT_FOUND_ERROR 151 The email template (email
body) is not found. Check
the server configuration.
MAIL_MESSAGING_ERROR 152 An error occurred when
sending email.
PDF_SAVING_DOC_ERROR 252 An IO error occurred when
trying to save a document
used in a transaction.
Check the server
configuration.
PDF_SERVER_CALL_ERROR 253 An error occurred when
calling internal PDF
server. Check the server
configuration.
PDF_BAD _ENCODING 255 Invalid PDF file encoding.
INVALID_XML_ENCODING 5000 The XML document
1 cannot be parsed properly.
9. EXAMPLES
Some CURL examples are presented below. They may be used from command line or
imported in tools like Postman. Values that must be changed are highlighted.
The first step before doing any WS call is to obtain a JWT token from your NGSign
account (Using bearer token). The token must be used in all WS calls:
Note: Authentication using Login/Password will be disable starting from version 2.16.
Input
curl 'https://app.ng-sign.com.tn/server/authenticate' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-raw 'email=test%40test.com&password=Password1' \
--compressed
35
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 36/49
Output
{"email":"[email protected]","firstName":"xxxx","lastName":"xxx
xxxx","phoneNumber":"xxxxxx","uuid":"xxxxxxx","roles":["USER"],"status":"CREATED"
,"tokensNumber":92,"orgTokensNumber":0,"customEmails":false,"sigPreconfigured":true,"
certificate":null,"digigoCertificate":null,"serialNumber":null,"certificateStatus":null,"manag
er":false,"organizationName":null,"registrationDate":null,"completeName":"xxxx"}
9.1.1.
Input
curl 'https://app.ng-sign.com.tn/server/protected/transaction/pdfs/' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Authorization: Bearer Your token goes here' \
--data-binary '[{"fileName":"NoteInterne","fileExtension":"pdf","fileBase64":"base64 of
the document"}]' \
--compressed
Output
{"object":{"uuid":"7d45cff2-17c8-497d-8064-
14fc14af2891","puuid":null,"creationDate":"2020-09-
02T01:07:16.487+0000","status":"CREATED","digestAlgo":null,"signingTime":null,"creat
or":{"email":"[email protected]","firstName":"Moez","lastName":"Ben
MBarka","phoneNumber":"52270383","uuid":"8ce07832-b383-4115-8dd0-
851047ea4a8a","roles":["USER"],"status":"CREATED","tokensNumber":92,"orgTokensNu
mber":0,"customEmails":true,"sigPreconfigured":true,"certificate":null,"digigoCertificate":n
ull,"serialNumber":null,"certificateStatus":null,"manager":false,"organizationName":null,"re
gistrationDate":null,"completeName":"Moez Ben
MBarka"},"nextSigner":null,"signers":[],"observers":[],"pdfs":[{"size":141226,"name":"Not
eInterne","extension":"pdf","identifier":"0ebef9f6-f39a-4a9d-adce-
2a03233b3000","pdfA":false}]},"message":null,"errorCode":0}
• transactionUuid is in blue.
• document identifier is in green.
Must use the transactionUuid and the document identifier returned by the previous web
service.
36
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 37/49
Input
curl 'https://app.ng-sign.com.tn/server/protected/transaction/transactionUuid/launch' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Authorization: Bearer Your token goes here' \
--data-binary '{"sigConf":[{"signer":{"firstName":"First Name","lastName":"Last
Name","email":"[email protected]","phoneNumber":"55555555"},"sigType":"CERTIFIED_TI
MESTAMP","docsConfigs":[{"page":1,"xAxis":81,"yAxis":44.28125,"documentName":"N
oteInterne","documentExtension":"pdf","identifier":"document
identifier"}],"mode":"FACE_TO_FACE","otp":"NONE"}], "message":"This is a message
included in the e-mail invitation that will be sent to all signatories."
”}' \
--compressed
Input
curl 'https://app.ng-sign.com.tn/server/any/transaction/66cc5fac-c657-43fa-b59e-
89d2639e616f/' \
-H 'Authorization: Bearer Your token goes here' \ \
--compressed
Output
{"object":{"uuid":"66cc5fac-c657-43fa-b59e-
89d2639e616f","puuid":null,"creationDate":"2020-09-
02T01:20:38.000+0000","status":"CONFIGURED","digestAlgo":"SHA256","signingTime"
:null,"creator":{"email":"test@ng-
sign.com","firstName":"XXX","lastName":"XXX","phoneNumber":"66666666","uuid":"8c
e07832-b383-4115-8dd0-
851047ea4a8a","roles":["USER"],"status":"CREATED","tokensNumber":92,"orgTokensNu
mber":0,"customEmails":true,"sigPreconfigured":true,"certificate":null,"digigoCertificate":n
ull,"serialNumber":null,"certificateStatus":null,"manager":false,"organizationName":null,"re
gistrationDate":null,"completeName":"XXXX"},"nextSigner":"41429481-4dfa-49a2-972b-
f2016053ca34","signers":[{"signer":{"email":"test@ng-
sign.com","firstName":"XXX","lastName":"XXXX","phoneNumber":"66666666","uuid":"8
ce07832-b383-4115-8dd0-
851047ea4a8a","roles":["USER"],"status":"CREATED","tokensNumber":92,"orgTokensNu
mber":0,"customEmails":true,"sigPreconfigured":true,"certificate":null,"digigoCertificate":n
ull,"serialNumber":null,"certificateStatus":null,"manager":false,"organizationName":null,"re
gistrationDate":null,"completeName":"XXXXX"},"status":"CONFIGURED","type":"CERT
IFIED_TIMESTAMP","mode":"FACE_TO_FACE","otp":"NONE","receiveDocument":tru
e,"signingTime":null,"redirectionUrl":null,"pdsAccessDate":"2020-09-
02T01:43:43.000+0000"}],"observers":[],"pdfs":[{"size":141226,"name":"NoteInterne","ext
ension":"pdf","identifier":"af4a3b5b-64d3-49f7-929a-
37
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 38/49
2603d204d9c9","pdfA":false}]},"message":null,"errorCode":0}
Input
curl 'https://app.ng-sign.com.tn/server/any/transaction/a3c12507-c8f6-464d-a5bd-
f50b4f2b32f8/pdfs/8d4054d2-a05d-4bba-ad99-6318709b5fcc' \
-H 'Authorization: Bearer Your token goes here' \
--compressed
Output
Input
Output
{"object":{"uuid":"7d45cff2-17c8-497d-8064-
14fc14af2891","puuid":null,"creationDate":"2020-09-
02T01:07:16.487+0000","status":"CREATED","digestAlgo":null,"signingTime":null,"creat
or":{"email":"[email protected]","firstName":"Moez","lastName":"Ben
MBarka","phoneNumber":"52270383","uuid":"8ce07832-b383-4115-8dd0-
851047ea4a8a","roles":["USER"],"status":"CREATED","tokensNumber":92,"orgTokensNu
mber":0,"customEmails":true,"sigPreconfigured":true,"certificate":null,"digigoCertificate":n
ull,"serialNumber":null,"certificateStatus":null,"manager":false,"organizationName":null,"re
gistrationDate":null,"completeName":"Moez Ben
MBarka"},"nextSigner":null,"signers":[],"observers":[],"pdfs":[{"size":141226,"name":"Not
eInterne","extension":"pdf","identifier":"0ebef9f6-f39a-4a9d-adce-
2a03233b3000","pdfA":false}]},"message":null,"errorCode":0}
38
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 39/49
NGSign allows signing more than one document in the same transaction.
Input
curl 'https://app.ng-sign.com.tn/server/protected/transaction/pdfs/' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Authorization: Bearer Your token goes here' \
--data-binary '[{"fileName":"NoteInterne","fileExtension":"pdf","fileBase64":"base64 of
the document"}, [{"fileName":"NoteInterne2","fileExtension":"pdf","fileBase64":"base64
of the document"}]' \
--compressed
Output
{
"object": {
"uuid": "8d1782c8-d8e1-484d-b469-eeacf936797c",
"puuid": null,
"creationDate": "2020-09-21T15:58:09.297+0000",
"status": "CREATED",
"digestAlgo": null,
"signingTime": null,
"creator": {
"email": "[email protected]",
"firstName": "First Name",
"lastName": "Last Name",
"phoneNumber": "XXXXXXX",
"uuid": "14073406-f497-43b4-9f4c-2f1d17edc9a1",
"roles": [
"USER"
],
"status": "CREATED",
"tokensNumber": 9,
"orgTokensNumber": 0,
"customEmails": false,
"sigPreconfigured": true,
"certificate": null,
"digigoCertificate": null
"serialNumber": null,
"certificateStatus": null,
"manager": false,
39
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 40/49
"organizationName": null,
"registrationDate": null,
"completeName": "Khaidja Ferjani"
},
"nextSigner": null,
"signers": [],
"observers": [],
"pdfs": [
{
"size": 33331,
"name": "NoteInterne",
"extension": "pdf",
"identifier": "aec1925c-ed9a-42ee-9248-d510ab74d4d5",
"pdfA": false
},
{
"size": 33331,
"name": "NoteInterne2",
"extension": "pdf",
"identifier": "9e8e5a08-0fae-4d95-9ee4-537555b10878",
"pdfA": false
}
]
},
"message": null,
"errorCode": 0
}
Input
curl -X POST \
https://app.ng-sign.com.tn/server/protected/transaction/8d1782c8-d8e1-484d-b469-
eeacf936797c/launch \
-H 'content-type: application/json' \
-H 'Authorization: Bearer Your token goes here' \
-d '{"observers":null,
"sigConf":[{"signer":{"email":"[email protected]","firstName":"First
Name","lastName":"Last Name","phoneNumber":"XXXXXXX","uuid":"14073406-f497-
43b4-9f4c-2f1d17edc9a1","roles":["USER"],"status":"CREATED",
"tokensNumber":9,"orgTokensNumber":0,"customEmails":false,"sigPreconfigured":true,"ce
rtificate":null,"digigoCertificate":null,"serialNumber":null,"certificateStatus":null,"manager
":false,"organizationName":null,"registrationDate":null,"completeName":"Khaidja
Ferjani"},"sigType":"CERTIFIED_TIMESTAMP","mode":"FACE_TO_FACE","otp":null,"
receiveDocument":true,"docsConfigs":[{"identifier":"aec1925c-ed9a-42ee-9248-
d510ab74d4d5","page":1,"xAxis":103.5,"yAxis":233}, {"identifier":"9e8e5a08-0fae-4d95-
40
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 41/49
9ee4-537555b10878","page":1,"xAxis":103.5,"yAxis":233}],"redirectionUrl":null}]}'
Output
{
"object": {
"uuid": "8d1782c8-d8e1-484d-b469-eeacf936797c",
"puuid": null,
"creationDate": "2020-09-21T15:58:09.000+0000",
"status": "CONFIGURED",
"digestAlgo": "SHA256",
"signingTime": null,
"creator": {
"email": "[email protected]",
"firstName": "First Name",
"lastName": "Last Name",
"phoneNumber": "XXXXXXX",
"uuid": "14073406-f497-43b4-9f4c-2f1d17edc9a1",
"roles": [
"USER"
],
"status": "CREATED",
"tokensNumber": 9,
"orgTokensNumber": 0,
"customEmails": false,
"sigPreconfigured": true,
"certificate": null,
"digigoCertificate":
"serialNumber": null,
"certificateStatus": null,
"manager": false,
"organizationName": null,
"registrationDate": null,
"completeName": "LastName FirstName"
},
"nextSigner": "e7139b61-88e9-4333-9bdb-713b07c6313e",
"signers": [
{
"signer": {
"email": "[email protected]",
"firstName": "First Name",
"lastName": "Last Name",
"phoneNumber": "XXXXXXX",
"uuid": "14073406-f497-43b4-9f4c-2f1d17edc9a1",
"roles": [
"USER"
],
41
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 42/49
"status": "CREATED",
"tokensNumber": 9,
"orgTokensNumber": 0,
"customEmails": false,
"sigPreconfigured": true,
"certificate": null,
"digigoCertificate": null
"serialNumber": null,
"certificateStatus": null,
"manager": false,
"organizationName": null,
"registrationDate": null,
"completeName": "Khaidja Ferjani"
},
"status": "CONFIGURED",
"type": "CERTIFIED_TIMESTAMP",
"mode": "FACE_TO_FACE",
"otp": "NONE",
"receiveDocument": true,
"signingTime": null,
"redirectionUrl": null,
"pdsAccessDate": null,
"pdfsUuid": [
"aec1925c-ed9a-42ee-9248-d510ab74d4d5",
"9e8e5a08-0fae-4d95-9ee4-537555b10878"
]
}
],
"observers": [],
"pdfs": [
{
"size": 33331,
"name": "NoteInterne",
"extension": "pdf",
"identifier": "aec1925c-ed9a-42ee-9248-d510ab74d4d5",
"pdfA": false
},
{
"size": 33331,
"name": "NoteInterne2",
"extension": "pdf",
"identifier": "9e8e5a08-0fae-4d95-9ee4-537555b10878",
"pdfA": false
}
]
},
"message": null,
42
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 43/49
"errorCode": 0
}
43
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 44/49
"tvaRate": 19,
"unitPrice": 10,
"totalPrice": 30,
"discount": 75
}
],
"invoiceTotalWithoutTax": 30,
"invoiceTotalWithTax": 39,
"invoiceTotalTax": 9,
"invoiceTotalinLetters": "Trente Neuf Dinars",
"stampTax": "0.6",
"tvaRate": 19,
"tvaTax": 9,
"totalDiscount": 0
},
"invoiceFileB64": "Base64 of the invoice PDF file",
"configuration": {
"qrPositionX": 10,
"qrPositionY": 10,
"qrPositionP": 1,
"labelPositionX": 100,
"labelPositionY": 100,
"labelPositionP": 1
},
"clientEmail": "[email protected]"
}'
Output:
{
"object": {
"status": "CREATED",
"clientEmail": "[email protected]",
"clientId": " Partner Reference ",
"ttnReference": null,
"invoiceNumber": "123455886",
"invoiceDate": "2021-05-11T08:04:04.547+00:00",
"amount": 39.0,
"uuid": "e5c54caf-b66f-476d-bedd-2d7c6342e81d"
},
"message": null,
"errorCode": 0
}
44
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 45/49
Output:
{
HasNgCert:false,
HasDigiGO:true
}
45
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 46/49
Prior to any WS call, the bearer token must be obtained from your NGSign account: Using
bearer token. This is only possible if the API option is enabled for your account.
CURL examples of these calls are given in Upload of PDF documents and Configure and
launch.
46
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 47/49
Main configurations
The configuration call takes as input an NGSignatureConfiguration which includes the list of
the expected signers (list of NGSignerConfiguration). The main configuration of each signer:
• The signature mode: most common value is BY_MAIL (the signer will receive an
email notification with a signing link). See Signature modes.
• The signature type: the type of certificate that the signer must use. See Signature
Types.
• The landing page: once the signer finishes the signature, he will be redirected to the
given page. See NGRedirectionUrl.
• The position of the signature field in the document. See NGDocumentConfig
Good to know
• If the position of the signature field is not known when calling the API, it is possible
to use an NGSign web interface to manually place the fields. In this case, the
integration is done in three steps:
47
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 48/49
• At any step while doing the workflows above or afterwards, it is possible to get the
current status of a transaction using a GET call Retrieving transaction information.
48
Internal NG Technologies 2022
NG Technologies Remote Trust Services
NGSIGN-WS
NGSign 2.20 - 1.0
NGSign WS Specifications Page 49/49
In most cases, Alfatoora API is used to send invoices from a business application (ERP, web
site…) to NGSign for electronic signature and submission to TTN. Once, the invoice is
stamped by TTN, the calling business application downloads the final PDF and XML
invoice.
Before using this API, ensure that the “Invoice” option is enabled for your NGSign account.
49
Internal NG Technologies 2022