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/cs-packages/{packageId}/documents/{documentId}/approvals
JS
HTTP Headers
Accept: application/json
Content-Type: application/json
Authorization: Bearer access_token
JS
Request Payload
{ "role": "Signer1", "id": "signature1", "fields": [ { "top": 510, "left": 215, "width": 200, "height": 50, "page": 0, "type": "SIGNATURE", "subtype": "FULLNAME" } ] }
JS
{ "role": "Signer1", "id": "signature1", "fields": [ { "top": 510, "left": 215, "width": 200, "height": 50, "page": 0, "type": "SIGNATURE", "subtype": "CAPTURE" } ] }
JS
{ "role": "Signer1", "id": "signature1", "fields": [ { "top": 510, "left": 215, "width": 200, "height": 50, "page": 0, "type": "SIGNATURE", "subtype": "INITIALS" } ] }
JS
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": "" }
JS
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://services.congamerge.com/api/cs-packages/{packageId}/documents/{documentId}/approvals/{approvalId}
JS
With the updated signature parameters:
{ "role": "Signer1", "fields": [ { "top": 510, "left": 215, "width": 300, "height": 50, "id": "signature1", "page": 0, "type": "SIGNATURE", "subtype": "CAPTURE" } ] }
JS
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.congamerge.com/api/cs-packages/{packageId}/documents/{documentId}/approvals/{signatureId}/
JS
Request Payload Table
Property | Type | Editable | Required | Default | Sample Values |
---|
role | string | Yes | No | n/a | Signer1 |
id | string | Yes | No | n/a | signature1 |
fields |
top | integer | Yes | No | 0 | 510 |
left | integer | Yes | No | 0 | 215 |
width | integer | Yes | No | 200 | 200 |
height | integer | Yes | No | 50 | 50 |
page | integer | Yes | No | 0 | 0 |
type | string | Yes | No | n/a | SIGNATURE/INPUT |
subtype | string | Yes | No | n/a | FULLNAME/INITIALS/CAPTURE/MOBILE_CAPTURE/
LABEL/TEXTFIELD/TEXTAREA/CHECKBOX/DATE/RADIO/LIST
|