Add fields using tags

When you generate your documents dynamically, it's difficult to know what the location of a field is in a document. For these kind of documents, Sign offers the option to add fields to a document using tags. With tags, you don't need to specify the coordinates of a field in a request and instead let the Sign API determine the location of the field dynamically. Tags are self chosen text values that can be placed anywhere in a document at the desired location.

Tags

A tag can be any text. It's important to make sure the chosen tag is unique and does not occur anywhere else in the document. It's recommended to wrap your tags in curly or square brackets to ensure uniqueness. To add fields for multiple invitees, a number can be added to the tag.

Examples: {signature1} and {signature2}; [sig1] and [sig2]

In case of initials, add the tag to every page the field should be added to.

Add tags to a document

Tags can be added in a document using your preferred text or PDF editor. Go to the location in the document where a tag is desired. Type a self chosen text value in that place, for example: {signature1} or [sig1]. Tags added to the document should be made the same color as the document's background color, to make it invisible and prevent the text from showing up in the document.

11331133

Note: for demonstration purposes tags have been made gray, instead of invisible.

API

POST /dossiers

In the example below a dossier request is shown. The functionality can be use by specifying the tag property. The value of this property should correspond to the tag added to the document, and is used by the Sign API to determine the location of the field in the file. If the tag could not be found, an error will be returned.

There is also an optional property called tagRequired. This property defaults to true and is used to indicate if a tag is required and should be present in the file. If tagRequired is false and the tag is not present, the field is omitted and no error is returned.

{
    "name": "Purchase contract",
    "files": [
        {
            "id": "3fa4ddab-56a4-48bb-9072-8a61b422ea82"
        }
    ],
    "invitees": [
        {
            "name": "John Doe",
            "email": "[email protected]",
            "fields": [
               {
                    "type": "text",
                    "file": "3fa4ddab-56a4-48bb-9072-8a61b422ea82",
                    "tag": "{name1}"
                },
                {
                    "type": "signature",
                    "file": "3fa4ddab-56a4-48bb-9072-8a61b422ea82",
                    "tag": "{signature1}"
                },
                {
                    "type": "signatureDate",
                    "file": "3fa4ddab-56a4-48bb-9072-8a61b422ea82",
                    "tag": "{date1}",
                    "tagRequired": false
                }
            ]
        },
        {
            "name": "Jane Doe",
            "email": "[email protected]",
            "fields": [
              {
                    "type": "text",
                    "file": "3fa4ddab-56a4-48bb-9072-8a61b422ea82",
                    "tag": "{name2}"
                },
                {
                    "type": "signature",
                    "file": "3fa4ddab-56a4-48bb-9072-8a61b422ea82",
                    "tag": "{signature2}"
                },
                {
                    "type": "signatureDate",
                    "file": "3fa4ddab-56a4-48bb-9072-8a61b422ea82",
                    "tag": "{date2}",
                }
            ]
        }
    ]
}

Did this page help you?