Adding Signatures
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 <host domain>/api/sign/v1/cs-packages/{packageId}/documents/{documentId}/approvals
HTTP Headers
Accept: application/json Content-Type: application/json Authorization: Bearer access_token
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:
<host domain>/api/sign/v1/cs-packages/{packageId}/documents/{documentId}/approvals/{approvalId}
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:
<host domain>/api/sign/v1/cs-packages/{packageId}/documents/{documentId}/approvals/{signatureId}/
Request Payload Table
Property |
Type |
Editable |
Required |
Default |
Sample Values |
---|---|---|---|---|---|
role |
string |
Yes |
No |
n/a |
|
id |
string |
Yes |
No |
n/a |
|
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 |
|
subtype |
string |
Yes |
No |
n/a |
|