API Documentation

API Overview

Cygnature rest API used to transfer the data on HTTP protocol. Rest is stands for stateless. You can make request to server and the server will be respond with the request information. Each request will be authorized based on token.

In this document we have describe the all endpoints with methods and request parameters with other details.

API EndPoints

Sandbox Rest API endpoint : https://cygnatureapipoc.stagingapplications.com/

1. Create Document (POST)
EndpointDescriptionHeader Parameters
api/document/createCreate the agreement with user and document basic information, placeholder details and geo metric information

Api-key: {{api-key}}

Content-Type: application/json

Request Model:

{
       “documentName”: “{{Name of Document with extension}}”,
       “userTimeZoneOffSet”: “+05:30”,
       “annotations”: [
             {
                      “x”: 21.64994,
                      “y”: 661.0043,
                      “w”: 233.67,
                      “h”: 83.65253,
                      “xPercentage”: 3.638645,
                      “yPercentage”: 78.50407,
                      “wPercentage”: 39.27227,
                      “hPercentage”: 9.934979,
                      “p”: {{Page No}},
                      “signersDetail”: {
                                “email”: “{{signer1Email}}”,
                                “firstName”: “{{FirstName}}”,
                                “lastName”: “{{LastName}}”
                                “signTag”: “{{sign tag}}” // Sign tag will be unique for each signer
                        }
            }
],
“OwnerDetail”: {
              “email”: “{{signer1Email}}”,
              “firstName”: “{{FirstName}}”,
              “lastName”: “{{LastName}}”
               },
              “documentBase64”: “{{base64 of File in word/pdf/excel/ppt format}}”
}
Note: coordinates are used for testing purpose.

Response Model:

{
           “message”: “Document has been uploaded successfully.”,
           “result”: {
                   “documentId”: ” a0993dda-95a5-4fc7-a9ac-96c5e6b21bde”,// Just for sample
                   “ownerToken”: ” 7eced341-9deb-469b-8d1e-8d76c3fbc417″ // Just for sample
           },
           “licenseInfo”: null
}

2. Get Document Access Token (GET)
EndpointDescriptionHeader Parameters
/api/document/{{documentId}}/get- access-token?email={{email}}Get access token for involved user’s in document using user’s email addressApi-key: {{api-key}} Content-Type: application/json

Response Model:

{
         “message”: “”,
         “result”: {
                “token”: “7eced341-9deb-469b-8d1e-8d76c3fbc417” // document access token
         },
        “licenseInfo”: null
}

3. Get Document Status (GET)
Endpoint Description Header Parameters
/api/document/{{documentId}}/status Get document status by document id. Document status : UnSigned = 0 Pending = 1 Signed = 2 Api-key: {{api-key}} Content-Type: application/json

Response Model:

{
        “message”: “”,
        “result”: {
               “documentStatus”: 2
        },
       “licenseInfo”: null​
}

4. Get Sign Document (GET)
Endpoint Description Header Parameters
/api/document/{{documentId}}/file?signed=true Get signed/partially signed document by document id. In addition you will also get the name of signer who has signed and who has not signed the document. Api-key: {{api-key}} Content-Type: application/json

Response Model:

{
         “message”: “”,
         “result”:”{
                 “documentData”: “{{document base64 data}}”
                 “signers”: [
                        {
                             “firstName”: “Signer1 First Name”,
                             “lastName”: ” Signer1 Last Name “,
                             “isSigned”: true
                        },
                        {
                            “firstName”: “Signer2 First Name”,
                            “lastName”: ” Signer2 Last Name “,
                            “isSigned”: false
                        }
               ]
         },
         “licenseInfo”: null
}

5. Get Unsigned Document (GET)
EndpointDescriptionHeader Parameters
/api/document/{{documentId}}/file?signed=falseGet unsigned document by document id.Api-key: {{api-key}} Content-Type: application/json

Response Model:

{
       “message”: “”,
       “result”:”{{base64 of unsigned document in pdf format}}”,
       “licenseInfo”: null
}

6. Auto Sign Document (POST)
Endpoint Description Header Parameters
/api/document/autosign Auto sign the document for predefined signer and his/her remain in all agreement. Api-key: {{api-key}} Content-Type: application/json

Request Model:

{
         “documentId”: “{{documentId}}”,
         “ownerEmail”: “{{document owner email}}”, // same as passed in create document API
         “sendSignedDocMail”: false,
         “signers”: [
               {
                      “email”: “{{signer1Email}}”, // same as passed in create document API
                      “stampDetail”: {
                                “appendAesthetic”: false,
                                “signOn”: true,
                                “signBy”: true,
                                “authId”: true
                        }
               },
              {
                     “email”: “{{signer2Email}}”, // same as passed in create document API
                     “stampDetail”: {
                               “appendAesthetic”: false,
                               “signOn”: true,
                               “signBy”: true,
                               “authId”: true
                           }
                }
          ]
}

Response Model:

{
         “message”: “”,
         “result”: {
                  “signerReponse”: [
                           {
                                 “signer”: “{{signer1Email}}”, // same as set in create document
                                 “signed”: true,
                                 “message”: “”
                            },
                           {
                                “signer”: “{{signer2Email}}”, // same as set in create document
                                “signed”: true,
                                “message”: “”
                           }
                    ]
          },
         “licenseInfo”: null
}
Note: Stamp details have set of flags, based on requirement for each signer’s sign format can be set
using those flag like sign on date, signer’s name and auth Id for each sign.

7. Get User E-Signature (GET)
Endpoint Description Header Parameters
api/user/profile/esignature?email={sig ner email address} Get E-signature of signer and user access token with expiry. For set signature you can get the access token from this api response. Use that same acccess token in UI widget code for set signature. Api-key: {{api-key}} Content-Type: application/json

Request Model:

{
         “message”: “”,
         “result”: {
                    “impressionModel”: {
                                “imageBytes”: {{Sign bytes if sign exist otherwise it will be null}},
                                “signatureType”: 0
                     },
                    “userAccessInfo”: {
                            “UserId”: “C252C221-0324-487F-846E-275101B7C188”,
                            “AccessToken”: “E8924BAC-7CE9-4D42-AE42-214BEC97C28D”,
                            “ExpiryTime”: “2019-09-26T07:14:53.097”
                     }
           },
          “licenseInfo”: null
}

Response Model:

{
         “message”: “”,
         “result”: {
                    “signerReponse”: [
                            {
                                  “signer”: “{{signer1Email}}”, // same as set in create document
                                  “signed”: true,
                                  “message”: “”
                            },
                            {
                                  “signer”: “{{signer2Email}}”, // same as set in create document
                                  “signed”: true,
                                  “message”: “”
                            }
                    ]
           },
          “licenseInfo”: null
}

UI Widget code

Javascript code for open Cygnature Sign page dialogue:
window.open(” {sandbox application
url}/Account/SetSignature?userId={userId}&accessToken={accessToken}&apiKey={apiKey}&callbackUrl={call back Url}”,
“_blank”,”toolbar=yes,scrollbars=yes,resizable=yes,top=100,left=100,width=60,height=100″)

Cygnature Sandbox Application URL: https://cygnature.stagingapplications.com

User Id: B62B1690-B105-49B3-A34E-2028826847B5 (you will get this user id in Get User E-Signature
API response)
Accesstoken: 7eced341-9deb-469b-8d1e-8d76c3fbc417 (You will get this token from get access
token api)
API-Key: qYaLsfbDovAl2sa2hTLUDPjokxGFXLlF (For Sandbox account) (Same api key will be used in
each API request header)

Note: Other parameters in window.open you can set based on your needs.