Managing Signers' Attachments
Sign offers the ability for signers to upload attachments during the signing workflow. Senders can review the provided attachment and mark the transaction as complete. This topic describes how a sender can require the signer to upload an attachment to the transaction.
Creating an Attachment Request
The following code describes how to add a recipient with an attachment requirement.
HTTP Request
POST <host domain>/api/sign/v1/cs-packages/{packageId}/roles
HTTP Headers
Accept: application/json Content-Type: application/json Authorization: Bearer access_token
Request Payload
{ "id": "client", "type": "SIGNER", "index": 1, "attachmentRequirements": [ { "description": "Please upload a scanned copy of your driver's license.", "required": true, "id": "lD6p5QnWk905", "status": "INCOMPLETE", "comment": "", "name": "Driver's license" } ], "signers": [ { "firstName": "John", "lastName": "Smith", "email": "john.smith@example.com" } ], "name": "client" }
For a complete description of each field, see the Request Payload Table below.
Response Payload
{ "id": "client", "data": null, "emailMessage": null, "attachmentRequirements": [ { "status": "INCOMPLETE", "description": "Please upload a scanned copy of your driver's license.", "required": true, "id": "1JMGfs9xRDoD", "comment": "", "name": "Driver's license", "data": null } ], "locked": false, "reassign": false, "specialTypes": [], "index": 1, "type": "SIGNER", "signers": [ { "group": null, "language": "en", "signature": null, "id": "fe666c24-c18d-4d93-bbb7-2b1a6ce8332e", "auth": { "scheme": "NONE", "challenges": [] }, "data": null, "title": "", "external": null, "updated": "2017-10-19T18:18:37Z", "company": "", "email": "john.smith@example.com", "firstName": "John", "lastName": "Smith", "phone": "", "professionalIdentityFields": [], "userCustomFields": [], "knowledgeBasedAuthentication": null, "delivery": { "provider": false, "email": false, "download": false }, "address": null, "created": "2017-10-19T18:18:37Z", "name": "", "specialTypes": [] } ], "name": "client" }
Downloading Attachments
Attachments can be downloaded in the following ways:
- As a single attachment. This requires the attachment id.
- In a package that includes all attachments.
- In a package that includes all attachments from a specified signer.
To download an individual attachment, you will need the package and attachment ID. The following code will do this:
HTTP Request
GET <host domain>/api/sign/v1/cs-packages/{packageId}/attachment/{attachmentId}
HTTP Headers
Accept: application/octet-stream Content-Type: application/octet-stream Authorization: Bearer access_token
Response Payload
[document.pdf]
You can also download all attachments as a zip file in a package. The following code will do this:
HTTP Request
GET <host domain>/api/sign/v1/cs-packages/{packageId}/attachment/zip
HTTP Headers
Accept: application/zip Content-Type: application/zip Authorization: Bearer access_token
Response Payload
[document.zip]
To download all attachments as a zip file for a particular signer, you will make your request to:
HTTP Request
GET <host domain>/api/sign/v1/cs-packages/{packageId}/attachment/zip/{roleId}
HTTP Headers
Accept: application/zip Content-Type: application/zip Authorization: Bearer access_token
Request Payload
[document.zip]
Reviewing Attachments
After reviewing the attachment, you can then either refuse or accept it. If you refuse the attachment, you can also include a small feedback message explaining why the attachment was refused. The following code will do this:
HTTP Request
PUT <host domain>/api/sign/v1/cs-packages/{packageId}/roles/{roleId}
HTTP Headers
Accept: application/json Content-Type: application/json Authorization: Bearer access_token
Request Payload
{ "attachmentRequirements": [ { "id": "q66CYiDrxTU1", "status": "REJECTED", "comment": "Invalid copy." } ] }
It is important to note that transactions that require attachments will not auto-complete. This gives the sender the opportunity to review the attachment, and either accept or reject it.
If all the required attachments have been uploaded and approved, you can complete the package by updating the status of your package to COMPLETED. The following code will do this:
HTTP Request
PUT <host domain>/api/sign/v1/cs-packages/{packageId}/
HTTP Headers
Accept: application/json Content-Type: application/json Authorization: Bearer access_token
Request Payload
{ "status" : "COMPLETED" }
JSON Property Table
Property |
Type |
Editable |
Required |
Default |
Sample Values |
---|---|---|---|---|---|
id |
string |
Yes |
No |
n/a |
|
type |
string |
Yes |
No |
SIGNER |
|
index |
integer |
Yes |
No |
0 |
|
name |
string |
Yes |
No |
n/a |
|
attachmentRequirements | |||||
description |
string |
Yes |
No |
n/a |
|
required |
boolean |
Yes |
No |
false |
|
id |
string |
Yes |
No |
n/a |
|
status |
string |
Yes |
No |
INCOMPLETE |
|
comment |
string |
Yes |
No |
n/a |
|
name |
string |
Yes |
No |
n/a |
|
signers | |||||
firstName |
string |
Yes |
No |
n/a |
|
lastName |
string |
Yes |
No |
n/a |
|
|
string |
Yes |
No |
n/a |