One of the most fundamental and basic operations in OneSpan Sign is that of inviting signers to sign documents. This guide will cover how to add, update, and remove a signer after creating a package.

The Code

To add a signer to an existing package, first create the Signer object.
Signer signer = SignerBuilder.newSignerWithEmail("[email protected]")
				.withFirstName("John")
				.withLastName("Smith")
				.withCustomId("Signer1")
				.build();
Next, grab the PackageId returned to you during package creation and use the OneSpan Sign client to add your signer.
String signerId = eslClient.getPackageService().addSigner(packageId, signer);
Similarly, to update an existing signer, create a Signer object with the updates you want to make.
Signer updatedSigner = SignerBuilder.newSignerWithEmail("[email protected]")
				.withFirstName("Mary")
				.withLastName("Doe")
				.withCustomId("Signer1")
				.build();
Then, grab the PackageId you wish to change this signer in and use the OneSpan Sign client to update the signer.
eslClient.getPackageService().updateSigner(packageId, updatedSigner);
To delete a signer, simply call the removeSigner function with the packageId and signerId string.
eslClient.getPackageService().removeSigner(packageId, signerId);

Running Your Code

After running your code, if you login to OneSpan Sign and navigate to your package, you should be able to see your signer added to your package.

signer

Get The Code

One of the most fundamental and basic operations in OneSpan Sign is that of inviting signers to sign documents. This guide will cover how to add, update, and remove a signer after creating a package.

The Code

To add a signer to an existing package, first create the Signer object.
Signer signer = SignerBuilder.NewSignerWithEmail("[email protected]")
				.WithFirstName("John")
				.WithLastName("Smith")
				.WithCustomId("Signer1")
				.Build();
Next, grab the PackageId returned to you during package creation and use the OneSpan Sign client to add your signer.
String signerId = eslClient.PackageService.AddSigner(packageId, signer);
Similarly, to update an existing signer, create a Signer object with the updates you want to make.
Signer updatedSigner = SignerBuilder.NewSignerWithEmail("[email protected]")
				.WithFirstName("Mary")
				.WithLastName("Doe")
				.WithCustomId("Signer1")
				.Build();
Then, grab the PackageId you wish to change this signer in and use the OneSpan Sign client to update the signer.
eslClient.PackageService.UpdateSigner(packageId, updatedSigner);
To delete a signer, simply call the RemoveSigner function with the packageId and signerId string.
eslClient.PackageService.RemoveSigner(packageId, signerId);

Running Your Code

After running your code, if you login to OneSpan Sign and navigate to your package, you should be able to see your signer added to your package.

signer

Get The Code

One of the most fundamental and basic operations in OneSpan Sign is that of inviting signers to sign documents. This guide will cover how to add, update, and remove a signer after creating a package.

The Code

Adding a signer to a package is done as shown below:

HTTP Request

POST /api/packages/{packageId}/roles

HTTP Headers

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

Request Payload

{
  "id": "Signer5",
  "type": "SIGNER",
  "signers": [
    {
      "email": "[email protected]",
      "firstName": "John",
      "lastName": "Smith",
      "id": "Signer5"
    }
  ],
  "name": "Signer5"
}
For a complete description of each field, take a look at the Request Payload section below.

Response Payload

{
    "id": "Signer5",
    "data": null,
    "specialTypes": [],
    "emailMessage": null,
    "attachmentRequirements": [],
    "locked": false,
    "reassign": false,
    "index": 0,
    "signers": [
        {
            "group": null,
            "language": "en",
            "signature": null,
            "id": "Signer5",
            "delivery": {
                "provider": false,
                "email": false,
                "download": false
            },
            "auth": {
                "scheme": "NONE",
                "challenges": []
            },
            "knowledgeBasedAuthentication": null,
            "data": null,
            "title": "",
            "company": "",
            "email": "[email protected]",
            "firstName": "John",
            "lastName": "Smith",
            "external": null,
            "updated": "2017-11-16T16:53:01Z",
            "phone": "",
            "professionalIdentityFields": [],
            "userCustomFields": [],
            "address": null,
            "created": "2017-11-16T16:53:01Z",
            "name": "",
            "specialTypes": []
        }
    ],
    "name": "Signer5",
    "type": "SIGNER"
}
To update an existing role/signer, create a payload with the updates you want to make and do the following request using the role id you assigned in the previous request. If you did not assign a role id, a randomly generated id will be assigned by OneSpan Sign.

HTTP Request

PUT /api/packages/{packageId}/roles/{roleId}

HTTP Headers

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

Request Payload

{
  "type": "SIGNER",
  "signers": [
    {
      "email": "[email protected]",
      "firstName": "Mary",
      "lastName": "Doe"
    }
  ]
}

Response Payload

{
    "id": "Signer5",
    "data": null,
    "specialTypes": [],
    "emailMessage": null,
    "attachmentRequirements": [],
    "locked": false,
    "reassign": false,
    "index": 0,
    "signers": [
        {
            "group": null,
            "language": "en",
            "signature": null,
            "id": "Signer5",
            "delivery": {
                "provider": false,
                "email": false,
                "download": false
            },
            "auth": {
                "scheme": "NONE",
                "challenges": []
            },
            "knowledgeBasedAuthentication": null,
            "data": null,
            "title": "",
            "company": "",
            "email": "[email protected]",
            "firstName": "Mary",
            "lastName": "Doe",
            "external": null,
            "updated": "2017-11-16T16:53:01Z",
            "phone": "",
            "professionalIdentityFields": [],
            "userCustomFields": [],
            "address": null,
            "created": "2017-11-16T16:53:01Z",
            "name": "",
            "specialTypes": []
        }
    ],
    "name": "Signer5",
    "type": "SIGNER"
}
To remove a signer, you make a DELETE request to the following URI:

HTTP Request

DELETE /api/packages/{packageId}/roles/{signerId}

HTTP Headers

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

Running Your Code

After running your code, if you login to OneSpan Sign and navigate to your package, you should be able to see your signer added to your package.

signer

Get The Code

Request Payload

PropertyTypeEditableRequiredDefaultSample Value(s)
idstringYesNon/aSigner5
reassignbooleanYesNofalsetrue / false
namestringYesNon/aSigner5
idstringYesNon/aSigner5
typestringYesNoSIGNERSIGNER / SENDER
signers
emailstringYesNon/a[email protected]
firstNamestringYesNon/aJohn
lastNamestringYesNon/aSmith
idstringYesNon/aSigner5
One of the most fundamental and basic operations in OneSpan Sign is that of inviting signers to sign documents. This guide will cover how to add, update, and remove a signer after creating a package.

The Code

To add a signer to an existing package, first create the Signer object.
ESignLiveAPIObjects.Role role = new ESignLiveAPIObjects.Role();
role.id = 'signer1';
role.signers = sdk.createRolesSigner('John', 'Smith', '[email protected]', 'CEO', 'ABC Bank');
sdk.helper.createRole(packageId, role);
Next, grab the PackageId returned to you during package creation and use the OneSpan Sign client to add your signer.
ESignLiveAPIObjects.Role retrievedRole = sdk.getRole(packageId, 'signer1');
Similarly, to update an existing signer, you can modify attributes except Role ID to the signer you retrieved.
retrievedRole.signers.get(0).firstName = 'changed firstname';
retrievedRole.signers.get(0).lastName = 'changed lastname';
retrievedRole.signers.get(0).email = '[email protected]';
Then, grab the PackageId you wish to change this signer in and use the OneSpan Sign sdk to update the signer.
sdk.updateRole(packageId,'signer1',retrievedRole);
To delete a signer, simply call the deleteRole function with the package ID and role ID string.
sdk.helper.deleteRole(packageId, 'signer1');

Running Your Code

After running your code, if you login to OneSpan Sign and navigate to your package, you should be able to see your signer added to your package.

signer

Get The Code