Download PDF
Download page Injecting Field Values.
Injecting Field Values
- The URL for the Push Notification Service is:
http://{SERVER_NAME:PORT}/PostEvent.svc/PostESLEvent
Here {
SERVER_NAME:PORT
} is a placeholder for the server name and port number. - The service can be hosted on any port you want.
- The server name and port must be accessible from the Internet.
- You may want to open your firewall exclusively to Sign's IP address.
- This URL should be used in Sign Account > Callback URL in the connector configuration.
PostESLEvent
is the method in the service that receivesHTTP POST
requests with a JSON payload as event data.
While this topic describes how to inject text fields into a document, the same procedure can be used to inject any type of unbound field. For more information on the types of unbound fields that are available, see Form Building Fields.
If you need a comparison to the basic object creation procedure, or if this is the first time creating a transaction, see Creating and Sending a Transaction.
The sample code below shows you how to edit the document block for injecting text fields. The withName()
method is used to input the name of the PDF form field you want to inject text into, as it is named in your PDF form. The withValue()
method is used as the text you want to stamp on your document.
The sample JSON below shows you how to edit the document object for injecting text fields. In the fields object, the name attribute is the name of the PDF form field you want to inject text into. The value attribute is where you input the text you want to inject into your document.
HTTP Request
POST /api/cs-packages
HTTP Headers
Accept: application/json
Content-Type: multipart/form-data
Authorization: Bearer access_token
Request Payload
------WebKitFormBoundary1bNO60n7FqP5WO4t Content-Disposition: form-data; name="file"; filename="testDocumentExtraction.pdf" Content-Type: application/pdf %PDF-1.5 %µµµµ 1 0 obj <>>> endobj.... ------WebKitFormBoundary1bNO60n7FqP5WO4t Content-Disposition: form-data; name="payload" { "documents": [ { "fields": [ { "value": "200 E MAIN ST, PHOENIX AZ, 85123 USA", "name": "Text1" }, { "value": "Lawn mower", "name": "Text2" }, { "value": "Fertilizer", "name": "Text3" }, { "value": "100", "name": "Text4" }, { "value": "12 12 12", "name": "Text5" } ], "extract": true, "name": "Sample Contract" } ], "type": "PACKAGE", "status": "DRAFT", "roles": [ { "id": "client", "index": 0, "type": "SIGNER", "signers": [ { "email": "john.smith@example.com", "firstName": "John", "lastName": "Smith", "id": "client" } ], "name": "client" }, { "id": "contractor", "index": 1, "type": "SENDER", "signers": [ { "email": "mary.doe@example.com", "firstName": "Mary", "lastName": "Doe", "id": "contractor" } ], "name": "contractor" } ], "name": "Field Injection Example" } ------WebKitFormBoundary1bNO60n7FqP5WO4t--
For a complete description of each field, see the Request Payload Table below.
Response Payload
{ "id": "9sKhW-h-qS9m6Ho3zRv3n2a-rkI=" }
Request Payload Table
Property | Type | Editable | Required | Default | Sample Values |
---|---|---|---|---|---|
status | string | Yes | No | DRAFT |
|
type | string | Yes | No | PACKAGE | PACKAGE/TEMPLATE/LAYOUT |
name | string | Yes | Yes | n/a | Field Injection Example |
documents | |||||
name | string | Yes | No | n/a | Sample Contract |
extract | boolean | Yes | No | false | false/true |
fields | |||||
value | string | Yes | No | n/a | 200 E MAIN ST, PHOENIX AZ 85123 USA |
name | string | Yes | No | n/a | Text1 |
roles | |||||
id | string | Yes | No | n/a | Client1 |
name | string | Yes | No | n/a | Client1 |
type | string | Yes | No | SIGNER | SIGNER/SENDER |
signers | |||||
string | Yes | Yes | n/a | john.smith@example.com | |
firstName | string | Yes | Yes | n/a | John |
lastName | string | Yes | Yes | n/a | Smith |
phone | string | Yes | No | n/a | 514-555-8888 |
id | string | Yes | No | n/a | Client1 |
company | string | Yes | No | n/a | Acme Inc. |
title | string | Yes | No | n/a | Managing Director |