Text Anchors
Text anchors allow you to position a field or signature based on the text in your document.
Adding Text Anchors
In this example, text anchors are used to add a signature, signing date, and signer name for each signer.
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.
Below is the JSON that will create your document package with text anchors. Please note that Sign's API convention allows only for only one signature field (for example, type: SIGNATURE) per approval in the approvals object. A second signature for a given role would need to be added as a separate approval.
Text Anchor Parameters
The following table provides a brief description of every parameter that can be passed when building your text anchors. Note the following:
- Text anchors are case-sensitive, and thus when using text anchors, the search is performed in a case-sensitive fashion.
- If a parameter is not specified, the default value below will be used.
Parameter |
Description |
Required |
Default Value |
---|---|---|---|
Anchor Text |
The exact string that will be searched for in your document. |
Yes |
Not applicable |
Anchor Point |
The corner of the specified character to use as the base for calculating the position. Available values: TOPLEFT, TOPRIGHT, BOTTOMLEFT, and BOTTOMRIGHT. |
No |
TOPLEFT |
Index |
The occurrence of the string. For example, a value of 1 will skip the first occurrence and use the second instance to calculate position. |
Yes |
Not applicable |
Character Index |
The index of the character within the anchor text that will be used to calculate the position. |
Yes |
Starting from 0 |
Left Offset |
The offset applied to the final x-coordinate. |
Yes |
Refer to the Offset Axis |
Top Offset |
The offset applied to the final y-coordinate. |
Yes |
Refer to the Offset Axis |
Height |
The height of the field or signature. |
Yes |
Not applicable |
Width |
The width of the field or signature. |
Yes |
Not applicable |
Best Practices for Using Text Anchors
If you are having problems putting your text anchors in their proper location, try using the offset attribute.
HTTP Request
HTTP Headers
Request Payload
For a complete description of each field, see the Request Payload Table below.
Response Payload
Request Payload Table
Property |
Type |
Editable |
Required |
Default |
Sample Values |
---|---|---|---|---|---|
status |
string |
Yes |
No |
DRAFT |
|
autoComplete |
boolean |
Yes |
No |
true |
|
type |
string |
Yes |
No |
PACKAGE |
|
name |
string |
Yes |
Yes |
n/a |
|
language |
string |
Yes |
Yes |
en |
|
documents | |||||
name |
string |
Yes |
No |
n/a |
|
approvals | |||||
role |
string |
Yes |
No |
n/a |
|
fields | |||||
type |
string |
Yes |
Yes |
n/a |
|
extract |
boolean |
Yes |
No |
false |
|
subtype |
string |
Yes |
Yes |
n/a |
|
binding |
string |
Yes |
No |
null |
|
left |
integer |
Yes |
No |
0 |
0 / 10 / 20 ... |
top |
integer |
Yes |
No |
0 |
0 / 10 / 20 ... |
extractAnchor | |||||
text |
string |
Yes |
Yes |
n/a |
|
anchorPoint |
string |
Yes |
Yes |
n/a |
|
index |
integer |
Yes |
No |
0 |
0 / 1 / 2 ... |
width |
integer |
Yes |
No |
200 |
150 |
characterIndex |
integer |
Yes |
No |
0 |
0 |
height |
integer |
Yes |
No |
50 |
40 |
leftOffset |
integer |
Yes |
No |
0 |
40 |
rightOffset |
integer |
Yes |
No |
0 |
-10 |
roles | |||||
id |
string |
Yes |
No |
n/a |
|
index |
integer |
Yes |
No |
0 |
1 / 2 / 3 ... |
name |
string |
Yes |
No |
n/a |
|
type |
string |
Yes |
No |
SIGNER |
|
signers | |||||
|
string |
Yes |
Yes |
n/a | |
firstName |
string |
Yes |
Yes |
n/a |
|
lastName |
string |
Yes |
Yes |
n/a |
|
id |
string |
Yes |
No |
n/a |
|