Placeholders

The following guide shows you how to add, update, and remove placeholders in templates.

A signature placeholder is useful if the identity of a signer/recipient will be determined at a later time (e.g. in templates). A placeholder can be assigned to a signature field just as if one were assigning a regular signer. However, all placeholders must be replaced by real signers before a transaction is distributed for signing. Because a signature placeholder has no email address, they are identified by an ID.

The Code

To add a placeholder in a template, you will first need to create your Placeholder object, as shown below:

Placeholder placeholder = new Placeholder("Manager");

Once you have built your Placeholder object, you use the OneSpan Sign TemplateService to add your placeholder in your template and pass the templateId along with the placeholder as parameters.

Placeholder addedPlaceholder = eslClient.getTemplateService().addPlaceholder(templateId, placeholder);

Updating a signature is also done in a similar fashion:

addedPlaceholder.setName("Client");
Placeholder updatedPlaceholder = eslClient.getTemplateService().updatePlaceholder(templateId, addedPlaceholder);

Finally, deleting a placeholder is also done with the PackageService. You will need to pass the templateId object , and placeholder id String as parameters.

eslClient.getPackageService().removeSigner(templateId, addedPlaceholder.getId());

Get the Code

A signature placeholder is useful if the identity of a signer/recipient will be determined at a later time (e.g. in templates). A placeholder can be assigned to a signature field just as if one were assigning a regular signer. However, all placeholders must be replaced by real signers before a transaction is distributed for signing. Because a signature placeholder has no email address, they are identified by an ID.

The Code

To add a placeholder in a template, you will first need to create your Placeholder object, as shown below:

Placeholder placeholder = new Placeholder("Manager");

Once you have built your Placeholder object, you use the OneSpan Sign TemplateService to add your placeholder in your template and pass the templateId along with the placeholder as parameters.

Placeholder addedPlaceholder = eslClient.TemplateService.AddPlaceholder(templateId, placeholder);

Updating a signature is also done in a similar fashion:

addedPlaceholder.Name = "Client";
Placeholder updatedPlaceholder = eslClient.TemplateService.UpdatePlaceholder(templateId, addedPlaceholder);

Finally, deleting a placeholder is also done with the PackageService. You will need to pass the templateId object, and placeholder id String as parameters.

eslClient.PackageService.RemoveSigner(templateId, addedPlaceholder.Id);

Get the Code

A signature placeholder is useful if the identity of a signer/recipient will be determined at a later time (e.g. in templates). A placeholder can be assigned to a signature field just as if one were assigning a regular signer. However, all placeholders must be replaced by real signers before a transaction is distributed for signing. Because a signature placeholder has no email address, they are identified by an ID.

The Code

To add a placeholder in a template, you will need to make:

HTTP Request
POST /api/packages/{templateId}/roles

HTTP Headers
Accept: application/json
Content-Type: application/json
Authorization: Basic api_key

Request Payload

{
  "id": "Manager",
  "type": "SIGNER",
  "index": 0,
  "name": "Manager"
}

For a complete description of each field, take a look at the JSON Properties section below.

Response Payload

{
    "id": "Manager",
    "data": null,
    "emailMessage": null,
    "attachmentRequirements": [],
    "locked": false,
    "reassign": false,
    "specialTypes": [],
    "type": "SIGNER",
    "index": 0,
    "signers": [],
    "name": "Manager"
}

Updating a placeholder is also done in a similar fashion. You will need to build the json with the updates you wish to make:

HTTP Request
PUT /api/packages/{templateId}/roles/[roleId}

HTTP Headers
Accept: application/json
Content-Type: application/json
Authorization: Basic api_key

Request Payload

{
  "id": "Manager",
  "type": "SIGNER",
  "index": 0,
  "name": "Manager"
}

Response Payload

{
    "id": "Manager",
    "data": null,
    "emailMessage": null,
    "attachmentRequirements": [],
    "locked": false,
    "reassign": false,
    "specialTypes": [],
    "type": "SIGNER",
    "index": 0,
    "signers": [],
    "name": "Manager"
}

Finally, to delete a placeholder:

HTTP Request
DELETE /api/packages/{templateId}/roles/{roleId}

HTTP Headers
Accept: application/json
Content-Type: application/json
Authorization: Basic api_key

Get the Code

JSON Properties

Property Type Editable Required Default Sample Value(s)
name string Yes No n/a Manager
id string Yes No n/a Manager
type stringer Yes No SIGNER SIGNER / SENDER
name string Yes No n/a Manager