To download the full code sample see our Code Share site.
One of the most fundamental and basic operations in OneSpan Sign is that of inviting signers A participant in a transaction, as specified by the transaction's creator. Note that the term "signer" is sometimes used instead of the term "recipient." to sign documents. This topic describes how to add, update, and remove signers from a transaction.
Adding Signers to a Transaction
To add a signer to an existing transaction, you must first create the Signer object. The following code will create a Signer object:
Signer signer = SignerBuilder.newSignerWithEmail("[email protected]") .withFirstName("John") .withLastName("Smith") .withCustomId("Signer1") .build();
For information on updating the authentication methods used for transactions, see Authenticating Signers.
Once the Signer object has been created, find the PackageId returned to you during the transaction creation and use the OneSpan Sign client to add your signer. The following code will do this:
String signerId = eslClient.getPackageService().addSigner(packageId, signer);
Updating an Existing Signer
Similarly, to update an existing signer, you must create a Signer object that contains the updates you want to make to your signer. The following code will do this:
Signer updatedSigner = SignerBuilder.newSignerWithEmail("[email protected]") .withFirstName("Mary") .withLastName("Doe") .withCustomId("Signer1") .build();
Once you have updated the signer, find the PackageId (the transaction) that you wish to change this signer in, and use the OneSpan Sign client to update the signer.
eslClient.getPackageService().updateSigner(packageId, updatedSigner);
Removing Signers From a Transaction
To remove a signer from a transaction, simply call the removeSigner function with the packageId and signerId string.
eslClient.getPackageService().removeSigner(packageId, signerId);
Results
After running your code, if you login to OneSpan Sign and navigate to your package, you will see your signer in your transaction.
To download the full code sample see our Code Share site.
One of the most fundamental and basic operations in OneSpan Sign is that of inviting signers A participant in a transaction, as specified by the transaction's creator. Note that the term "signer" is sometimes used instead of the term "recipient." to sign documents. This topic describes how to add, update, and remove signers from a transaction.
Adding Signers to a Transaction
To add a signer to an existing transaction, you must first create the Signer object. The following code will create a Signer object:
Signer signer = SignerBuilder.NewSignerWithEmail("[email protected]") .WithFirstName("John") .WithLastName("Smith") .WithCustomId("Signer1") .Build();
Once you have updated the signer, find the PackageId (the transaction) that you wish to change this signer in, and use the OneSpan Sign client to update the signer.
String signerId = eslClient.PackageService.AddSigner(packageId, signer);
For information on updating the authentication methods used for transactions, see Authenticating Signers.
Updating an Existing Signer
Similarly, to update an existing signer, you must create a Signer object that contains the updates you want to make to your signer. The following code will do this:
Signer updatedSigner = SignerBuilder.NewSignerWithEmail("[email protected]") .WithFirstName("Mary") .WithLastName("Doe") .WithCustomId("Signer1") .Build();
Once you have updated the signer, find the PackageId (the transaction) that you wish to change this signer in, and use the OneSpan Sign client to update the signer.
eslClient.PackageService.UpdateSigner(packageId, updatedSigner);
Removing Signers From a Transaction
To remove a signer from a transaction, simply call the removeSigner function with the packageId and signerId string.
eslClient.PackageService.RemoveSigner(packageId, signerId);
Results
After running your code, if you login to OneSpan Sign and navigate to your package, you will see your signer in your transaction.
To download the full code sample see our Code Share site.
One of the most fundamental and basic operations in OneSpan Sign is that of inviting signers A participant in a transaction, as specified by the transaction's creator. Note that the term "signer" is sometimes used instead of the term "recipient." to sign documents. This topic describes how to add, update, and remove signers from a transaction.
Adding Signers to a Transaction
To add a signer to an existing transaction, use the following code:
HTTP Request
POST /api/packages/{packageId}/roles
For information on updating the authentication methods used for transactions, see Authenticating Signers.
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, see the Request Payload table 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" }
Updating an Existing Signer
To update an existing signer (role), first create a payload with the updates you want to make and then use the request examples below to make your updates. Use the roleid you assigned in the previous request.
If you did not assign a roleid, 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" }
For a complete description of each field, see the Request Payload table below.
Removing Signers From a Transaction
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
Results
After running your code, if you login to OneSpan Sign and navigate to your package, you will see your signer in your transaction.
Request Payload Table
Property | Type | Editable | Required | Default | Sample Values |
---|---|---|---|---|---|
id | string | Yes | No | n/a | Signer5 |
reassign | boolean | Yes | No | false | true / false |
name | string | Yes | No | n/a | Signer5 |
id | string | Yes | No | n/a | Signer5 |
type | string | Yes | No | SIGNER | SIGNER / SENDER |
signers | |||||
string | Yes | No | n/a | [email protected] | |
firstName | string | Yes | No | n/a | John |
lastName | string | Yes | No | n/a | Smith |
id | string | Yes | No | n/a | Signer5 |
To download the full code sample see our Code Share site.
One of the most fundamental and basic operations in OneSpan Sign is that of inviting signers A participant in a transaction, as specified by the transaction's creator. Note that the term "signer" is sometimes used instead of the term "recipient." to sign documents. This topic describes how to add, update, and remove signers from a transaction.
Adding Signers to a Transaction
To add a signer to an existing transaction, you must first create the Signer object. The following code will create a 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);
Once the Signer object has been created, find the PackageId returned to you during the transaction creation and use the OneSpan Sign client to add your signer. The following code will do this:
ESignLiveAPIObjects.Role retrievedRole = sdk.getRole(packageId, 'signer1');
For information on updating the authentication methods used for transactions, see Authenticating Signers.
Updating an Existing Signer
To update an existing signer, simply modify any of your Signer attributes, by retrieving that signer. All attributes, with the exception of RoleID, can be modified.The following code will do this:
retrievedRole.signers.get(0).firstName = 'changed firstname'; retrievedRole.signers.get(0).lastName = 'changed lastname'; retrievedRole.signers.get(0).email = '[email protected]';
Then, find the PackageId you wish to change this signer in and use the OneSpan Sign sdk to update the signer.
sdk.updateRole(packageId,'signer1',retrievedRole);
Removing Signers from a Transaction
To remove a signer from a transaction, simply call the deleteRole function with the packageID and roleId string.
sdk.helper.deleteRole(packageId, 'signer1');
Results
After running your code, if you login to OneSpan Sign and navigate to your package, you will see your signer in your transaction.