To download the full code sample see our Code Share site.

Adding a Signature to a Document

To add a signature to a document, you will first need to create your Signature object using the OneSpan Sign SignatureBuilder. The following code will do this:

 //Fullname signature style   Signature signature1 = SignatureBuilder.signatureFor("[email protected]")   .onPage(0)   .atPosition(215, 510)   .withSize(200, 50)   .withId(new SignatureId("signature1"))   .build();   //Handwritten signature style   Signature signature2 = SignatureBuilder.captureFor("[email protected]")   .onPage(0)   .atPosition(215, 510)   .withSize(200, 50)   .withId(new SignatureId("signature2"))   .build();   //Initials signature style   Signature signature3 = SignatureBuilder.initialsFor("[email protected]")   .onPage(0)   .atPosition(215, 510)   .withSize(200, 50)   .withId(new SignatureId("signature3"))   .build();   DocumentPackage createdPackage = client.getPackageService().getPackage(packageId); 

Once you have built your Signature object, retrieve your transaction using the OneSpan Sign client. Then, using the OneSpan Sign ApprovalService, add your signature to your document. Use the DocumentPackage, Signature objects, and documentID as parameters. The following code will do this:

 client.getApprovalService().addSignature(createdPackage, documentId, signature1); 

Updating a Signature On a Document

You can update a signature that has already been associated with a document. The following code will do this:

 Signature updatedSignature = SignatureBuilder.captureFor("[email protected]")   .onPage(0)   .atPosition(215, 510)   .withSize(300, 50)   .withId(new SignatureId("signature1"))   .build();   List<Signature> signatures = new ArrayList();  signatures.add(updatedSignature);   DocumentPackage updatedPackage = client.getPackageService().getPackage(packageId);   client.getApprovalService().updateSignatures(updatedPackage, documentId, signatures); 

When updating a signature, your new Signature object must have the same id as the signature you want to update.

Deleting a Signature From a Document

Deleting a signature from a document is done using the OneSpan Sign ApprovalService. Use the PackageID, SignatureID, and documentID as parameters. The following code will do this:

 client.getApprovalService().deleteSignature(packageId, documentId, new SignatureId("signature1")); 

Results

Once you have run your code, your signatures will appear in your transaction's documents.

To download the full code sample see our Code Share site.

Adding a Signature to a Document

To add a signature to a document, you will first need to create your Signature object using the OneSpan Sign SignatureBuilder. The following code will do this:

 //Fullname signature style   Signature signature1 = SignatureBuilder.SignatureFor("[email protected]")   .OnPage(0)   .AtPosition(215, 510)   .WithSize(200, 50)   .WithId(new SignatureId("signature1"))   .Build();   //Handwritten signature style   Signature signature2 = SignatureBuilder.CaptureFor("[email protected]")   .OnPage(0)   .AtPosition(215, 510)   .WithSize(200, 50)   .WithId(new SignatureId("signature2"))   .Build();   //Initials signature style   Signature signature3 = SignatureBuilder.InitialsFor("[email protected]")   .OnPage(0)   .AtPosition(215, 510)   .WithSize(200, 50)   .WithId(new SignatureId("signature3"))   .Build();   DocumentPackage createdPackage = client.GetPackage(packageId); 

Once you have built your Signature object, retrieve your transaction using the OneSpan Sign client. Then, using the OneSpan Sign ApprovalService, add your signature to your document. Use the DocumentPackage, Signature objects, and documentID as parameters. The following code will do this:

 client.ApprovalService.AddApproval(createdPackage, documentId, signature1); 

Updating a Signature On a Document

You can update a signature that has already been associated with a document. The following code will do this:

 Signature updatedSignature = SignatureBuilder.CaptureFor("[email protected]")   .OnPage(0)   .AtPosition(215, 510)   .WithSize(300, 50)   .WithId(new SignatureId("signature1"))   .Build();   IList<Signature> signatures = new List();  signatures.Add(updatedSignature);   DocumentPackage updatedPackage = client.GetPackage(packageId);   client.ApprovalService.UpdateApprovals(updatedPackage, documentId, signatures); 

When updating a signature, your new Signature object must have the same id as the signature you want to update.

Deleting a Signature From a Document

Deleting a signature from a document is done using the OneSpan Sign ApprovalService. Use the PackageID, SignatureID, and documentID as parameters. The following code will do this:

 client.ApprovalService.DeleteApproval(packageId, documentId, "signature1"); 

Results

Once you have run your code, your signatures will appear in your transaction's documents.

To download the full code sample see our Code Share site.

Adding a Signature to a Document

To add a signature to a document, you will first need to edit the fields object. The following code will do this:

HTTP Request

POST /api/packages/{packageId}/documents/{documentId}/approvals

HTTP Headers

 Accept: application/json   Content-Type: application/json   Authorization: Basic api_key 

Request Payload

 {   "role": "Signer1",   "id": "signature1",   "fields": [   {   "top": 510,   "left": 215,   "width": 200,   "height": 50,   "page": 0,   "type": "SIGNATURE",   "subtype": "FULLNAME"   }   ]   } 
 {   "role": "Signer1",   "id": "signature1",   "fields": [   {   "top": 510,   "left": 215,   "width": 200,   "height": 50,   "page": 0,   "type": "SIGNATURE",   "subtype": "CAPTURE"   }   ]   } 
 {   "role": "Signer1",   "id": "signature1",   "fields": [   {   "top": 510,   "left": 215,   "width": 200,   "height": 50,   "page": 0,   "type": "SIGNATURE",   "subtype": "INITIALS"   }   ]   } 

For a complete description of each field, see the Request Payload table below.

Response Payload

 {   "signed": null,   "role": "Signer1",   "accepted": null,   "id": "signature1",   "data": null,   "fields": [   {   "top": 50,   "left": 300,   "height": 50,   "page": 0,   "type": "SIGNATURE",   "validation": null,   "binding": null,   "width": 200,   "subtype": "FULLNAME",   "extract": false,   "extractAnchor": null,   "id": "tx1qz7485780",   "data": null,   "value": "",   "name": ""   }   ],   "name": ""   } 

Updating a Signature On a Document

You can update a signature that has already been associated with a document. To update a signature, you will need to make a PUT request to:

 https://sandbox.esignlive.com/api/packages/{packageId}/documents/{documentId}/approvals/{signatureId}/ 

With the updated signature parameters:

 {   "role": "Signer1",   "fields": [   {   "top": 510,   "left": 215,   "width": 300,   "height": 50,   "id": "signature1",   "page": 0,   "type": "SIGNATURE",   "subtype": "CAPTURE"   }   ]   } 

When updating a signature, your new Signature object must have the same id as the signature you want to update.

Deleting a Signature From a Document

Finally, deleting a signature is done by making a DELETE request to:

 https://sandbox.esignlive.com/api/packages/{packageId}/documents/{documentId}/approvals/{signatureId}/ 

Results

Once you have run your code, your signatures will appear in your transaction's documents.

Request Payload Table

PropertyTypeEditableRequiredDefaultSample Values
rolestringYesNon/aSigner1
idstringYesNon/asignature1
fields
topintegerYesNo0510
leftintegerYesNo0215
widthintegerYesNo200200
heightintegerYesNo5050
pageintegerYesNo00
typestringYesNon/aSIGNATURE / INPUT
subtypestringYesNon/aFULLNAME / INITIALS / CAPTURE / MOBILE_CAPTURE / LABEL / TEXTFIELD / TEXTAREA / CHECKBOX / DATE / RADIO / LIST

To download the full code sample see our Code Share site.

Adding a Signature to a Document

To add a signature to a document, you will first need to create your Approvalobject. The following code will do this:

  //#1.   Add signature   //Fullname signature style   ESignLiveAPIObjects.Field field_fullname = new ESignLiveAPIObjects.Field();   field_fullname.id = 'field_fullname';   field_fullname.type = 'SIGNATURE';   field_fullname.subtype = 'FULLNAME';   field_fullname.page = 0;   field_fullname.top = 100.0;   field_fullname.left = 50.0;   field_fullname.width = 150.0;   field_fullname.height = 50.0;   ESignLiveAPIObjects.Approval approval_fullname = new ESignLiveAPIObjects.Approval();   approval_fullname.fields = new List<ESignLiveAPIObjects.Field>{field_fullname};   approval_fullname.id = 'approval_fullname';   approval_fullname.role = roleId;   //Capture signature style   ESignLiveAPIObjects.Field field_capture = new ESignLiveAPIObjects.Field();   field_capture.id = 'field_capture';   field_capture.type = 'SIGNATURE';   field_capture.subtype = 'CAPTURE';   field_capture.page = 0;   field_capture.top = 200.0;   field_capture.left = 50.0;   field_capture.width = 150.0;   field_capture.height = 50.0;   ESignLiveAPIObjects.Approval approval_capture = new ESignLiveAPIObjects.Approval();   approval_capture.fields = new List<ESignLiveAPIObjects.Field>{field_capture};   approval_capture.id = 'approval_capture';   approval_capture.role = roleId;   //Initials signature style   ESignLiveAPIObjects.Field field_initials = new ESignLiveAPIObjects.Field();   field_initials.id = 'field_initials';   field_initials.type = 'SIGNATURE';   field_initials.subtype = 'INITIALS';   field_initials.page = 0;   field_initials.top = 300.0;   field_initials.left = 50.0;   field_initials.width = 150.0;   field_initials.height = 50.0;   ESignLiveAPIObjects.Approval approval_initials = new ESignLiveAPIObjects.Approval();   approval_initials.fields = new List<ESignLiveAPIObjects.Field>{field_initials};   approval_initials.id = 'approval_initials';   approval_initials.role = roleId; 

Once you have built your Signature object, use the OneSpan Sign SDK client to add your signature to your document. Use the PackageID, Signature object, and documentID as parameters. The following code will do this:

  ESignLiveSDK sdk = new ESignLiveSDK();   //String packageId, String documentId,ESignLiveAPIObjects.Approval approval   sdk.addSignature(packageId, documentId, approval_fullname);   sdk.addSignature(packageId, documentId, approval_capture);   sdk.addSignature(packageId, documentId, approval_initials); 

Updating a Signature On a Document

You can update a signature that has already been associated with a document. The following code will do this:

  //#2.   update single signature   ESignLiveAPIObjects.Field label_field_fullname = new ESignLiveAPIObjects.Field();   label_field_fullname.id = 'label_field_fullname';   label_field_fullname.type = 'INPUT';   label_field_fullname.subtype = 'LABEL';   label_field_fullname.value = 'label value fullname';   label_field_fullname.page = 0;   label_field_fullname.top = 100.0;   label_field_fullname.left = 250.0;   label_field_fullname.width = 150.0;   label_field_fullname.height = 50.0;   approval_fullname.fields.add(label_field_fullname);   //String packageId, String documentId, String approvalId, ESignLiveAPIObjects.Approval approval   sdk.updateApproval(packageId, documentId, 'approval_fullname', approval_fullname); 

When updating a signature, your new Signature object must have the same id as the signature you want to update.

Deleting a Signature From a Document

Deleting a signature from a document is done using the OneSpan Sign SDK Client. Use the PackageID, ApprovalID, and documentID as parameters. The following code will do this:

  //#4.   delete signature   sdk.deleteApproval(packageId, documentId, 'approval_fullname'); 

Results

Once you have run your code, your signatures will appear in your transaction's documents.