To download the full code sample see our Code Share site.
OneSpan Sign provides you with the ability to add users to your account, allowing them to create and send transactions for digital signing .
As an account owner, you will have access to the transactions created by your users. However you can only retrieve these transactions using SDKs or APIs. If you want to access these transactions using the Web UI you will need your users to delegate access to you.
OneSpan Sign allows you to grant others in your organization access to your account. With Access Delegation, your assigned delegate (the person to whom you have granted access) can send and sign documents on your behalf. For more information, see Delegating Access.
Finding Your Users in the UI
First, locate your senders in the OneSpan Sign Web UI. To do this, log into your OneSpan Sign account and click Admin > Users. After running your code, all your users will appear here.
The Users page replaces the Senders page if Roles and Permissions have been enabled. To enable Roles and Permissions contact our Support Team.
For more information, see Administering Users.
Adding Users
To add a user to your account, you will need to build an AccountMember object. Then, you can all on your OneSpan Sign AccountService to send an invitation to the user. Once a new user has been invited to join an account, they are automatically added to the account, but in an inactive state. The user will receive an email containing a link that they will need to click to activate their account.
You can skip this verification step by setting the status to ACTIVE when building your AccountMember object.
AccountMember member = AccountMemberBuilder.newAccountMember("[email protected] ") .withFirstName("John") .withLastName("Smith") .withCompany("ABC Bank") .withTitle("CEO") .withStatus(SenderStatus.ACTIVE) .build(); client.getAccountService().inviteUser(member);
Resending an Account Invitation
When a user is invited to join an account, they are sent an email which they must use to activate their account. The following code snippet illustrates how to re-send that email.
eslClient.getAccountService().sendInvite(retrievedSender.getId());
Retrieving Users
The first step to delegating access is to retrieve a list of users from your OneSpan Sign account, which is described in the following code example. Included in this list are your user's email addresses, and their IDs. User IDs are required to add and remove delegates.
The maximum number of users that you can retrieve, as defined by this API, is 100.
Here is some sample code that describes how to do this. In this example, the number of users returned in the list is 5, as defined by PageRequest.
int i = 1; Map<String, Sender> accountMembers = client.getAccountService().getSenders(Direction.ASCENDING, new PageRequest(i,5)); while(!accountMembers.isEmpty()) { for (Map.Entry entry : accountMembers.entrySet()) { String email = (String) entry.getKey(); Sender sender = (Sender) entry.getValue(); System.out.println(email + ", " + sender.getId()); i++; } accountMembers = client.getAccountService().getSenders(Direction.ASCENDING, new PageRequest(i,5)); }
Updating a User
To update a user you will need their user ID. Note that an email address cannot be updated once you’ve created your user. To change an email address you will need to create a new user.
SenderInfo updatedSenderInfo = SenderInfoBuilder.newSenderInfo("[email protected]") .withName( "John", "Smith" ) .withTitle( "CEO" ) .withCompany("XYZ Bank") .build(); client.getAccountService().updateSender(updatedSenderInfo, "{senderId}");
Deleting a User
To delete a user you will need their user ID. Here is some sample code that describes how to do this.
If your user has transactions already in their Inbox, or transactions in a Draft status, the user will be locked instead of deleted. They will not be able to create or send any other transactions.
client.getAccountService().deleteSender("{senderId}");
Retrieving a Specific User
The following sample code helps you retrieve a specific user from an account.
Sender retrievedSender = eslClient.getAccountService().getSender("senderId");
Sending a Transaction Using a Specific Sender
The sample code below shows you how to build a transaction to be sent by a specific user:
DocumentPackage packageToSend = PackageBuilder.newPackageNamed("Cleaning Contract Example") .withSenderInfo(SenderInfoBuilder.newSenderInfo("[email protected]")) .withSigner(SignerBuilder.newSignerWithEmail("[email protected]") .withFirstName("Mary") .withLastName("Doe") .withCustomId("client")) .withSigner(SignerBuilder.newSignerWithEmail("[email protected]") .withFirstName("John") .withLastName("Smith") .withCustomId("contractor")) .withDocument(DocumentBuilder.newDocumentWithName("Contract.pdf") .fromStream(new FileInputStream("DOC_FILE_PATH"), DocumentType.PDF) .enableExtraction()) .build();
Results
After executing your code, you will find your newly created users in your OneSpan Sign account.
To download the full code sample see our Code Share site.
OneSpan Sign provides you with the ability to add users to your account, allowing them to create and send transactions for digital signing .
As an account owner, you will have access to the transactions created by your users. However you can only retrieve these transactions using SDKs or APIs. If you want to access these transactions using the Web UI you will need your users to delegate access to you.
For more information, see Delegating Access.
Finding Your Users in the UI
First, locate your senders in the OneSpan Sign Web UI. To do this, log into your OneSpan Sign account and click Admin > Users. After running your code, all your users will appear here.
The Users page replaces the Senders page if Roles and Permissions have been enabled. To enable Roles and Permissions contact our Support Team.
For more information, see Administering Users.
Adding Users
To add a user to your account, you will need to build an AccountMember object. Then, you can all on your OneSpan Sign AccountService to send an invitation to the user. Once a new user has been invited to join an account, they are automatically added to the account, but in an inactive state. The user will receive an email containing a link that they will need to click to activate their account.
You can skip this verification step by setting the status to ACTIVE when building your AccountMember object.
AccountMember member = AccountMemberBuilder.NewAccountMember("[email protected]") .WithFirstName("John") .WithLastName("Smith") .WithCompany("ABC Bank") .WithTitle("CEO") .WithStatus(SenderStatus.ACTIVE) .Build(); client.AccountService.InviteUser(member);
Resending an Account Invitation
When a user is invited to join an account, they are sent an email which they must use to activate their account. The following code snippet illustrates how to re-send that email.
eslClient.AccountService.SendInvite(retrievedSender.Id);
Retrieving Users
The first step to delegating access is to retrieve a list of users from your OneSpan Sign account, which is described in the following code example. Included in this list are your user's email addresses, and their IDs. User IDs are required to add and remove delegates.
The maximum number of users that you can retrieve, as defined by this API, is 100.
Here is some sample code that describes how to do this. In this example, the number of users returned in the list is 5, as defined by PageRequest.
int i = 1; IDictionary<string, Sender> accountMembers = client.AccountService.GetSenders(Direction.ASCENDING, new PageRequest(i, 5)); while (accountMembers.Count != 0) { foreach (var s in accountMembers) { string email = s.Key.ToString(); string id = s.Value.Id; Debug.WriteLine(email + " " + id); i++; } accountMembers = client.AccountService.GetSenders(Direction.ASCENDING, new PageRequest(i, 5)); }
Updating a User
To update a user you will need their user ID. Note that an email address cannot be updated once you’ve created your user. To change an email address you will need to create a new user.
SenderInfo updatedSenderInfo = SenderInfoBuilder.NewSenderInfo("[email protected]") .WithName( "John", "Smith" ) .WithTitle( "CEO" ) .WithCompany("XYZ Bank") .Build(); client.AccountService.UpdateSender(updatedSenderInfo, "{senderId}");
Deleting a User
To delete a user you will need their user ID. Here is some sample code that describes how to do this.
If your user has transactions already in their Inbox, or transactions in a Draft status, the user will be locked instead of deleted. They will not be able to create or send any other transactions.
client.AccountService.DeleteSender("{senderId}");
Retrieving a Specific User
The following sample code helps you retrieve a specific user from an account.
Sender retrievedSender = eslClient.AccountService.GetSender("senderId");
Sending a Transaction Using a Specific Sender
The sample code below shows you how to build a transaction to be sent by a specific user:
DocumentPackage packageToSend = PackageBuilder.NewPackageNamed("Cleaning Contract Example") .WithSenderInfo(SenderInfoBuilder.NewSenderInfo("[email protected]")) .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected] ") .WithFirstName("Mary") .WithLastName("Doe") .WithCustomId("client")) .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]") .WithFirstName("John") .WithLastName("Smith") .WithCustomId("contractor")) .WithDocument(DocumentBuilder.NewDocumentNamed("Contract.pdf") .FromStream(new FileStream("DOC_FILE_PATH", FileMode.Open), DocumentType.PDF) .EnableExtraction()) .Build();
Results
After executing your code, you will find your newly created users in your OneSpan Sign account.
To download the full code sample see our Code Share site.
OneSpan Sign provides you with the ability to add users to your account, allowing them to create and send transactions for digital signing .
As an account owner, you will have access to the transactions created by your users. However you can only retrieve these transactions using SDKs or APIs. If you want to access these transactions using the Web UI you will need your users to delegate access to you.
For more information, see Delegating Access.
Senders in the UI
First, locate your senders in the OneSpan Sign Web UI. To do this, log into your OneSpan Sign account and click Admin > Users. After running your code, all your users will appear here.
The Users page replaces the Senders page if Roles and Permissions have been enabled. To enable Roles and Permissions contact our Support Team.
For more information, see Administering Users.
Adding Users
To add a user to you account, use the following code examples.
HTTP Request
POST /api/account/senders
HTTP Headers
Accept: application/json Content-Type: application/json Authorization: Basic api_key
Request Payload
{ "email" : "[email protected]", "firstName" : "John", "lastName" : "Smith", "company" : "ABC Bank", "title" : "CEO", "status" : "ACTIVE" }
Response Payload
{ "status": "ACTIVE", "language": "en", "signature": null, "id": "gF0JJvbDb2Y0", "data": { "hasNotCreatedATransaction": true, "showIntro": true }, "account": { "id": "3vD0Dc9Fh7wQ", "data": null, "updated": "2016-05-05T19:30:13Z", "company": { "id": "jVWmyg4cyis8", "data": null, "address": { "address1": null, "address2": null, "city": null, "country": null, "zipcode": null, "state": null }, "name": "OneSpan Sign" }, "licenses": [ { "status": "ACTIVE", "paidUntil": "2020-05-05T00:00:00Z", "plan": { "group": "", "description": "E-Sign Hundreds of Documents with Unlimited Signers", "id": "sandbox", "features": null, "price": { "amount": 0, "currency": { "id": "USD", "data": null, "name": "US Dollar" } }, "original": null, "cycle": "YEAR", "contract": "YEAR", "freeCycles": null, "quotas": [ { "cycle": null, "scope": "ACCOUNT", "limit": 100, "target": "SENDER" }, { "cycle": null, "scope": "SENDER", "limit": 500, "target": "DOCUMENT" }, { "cycle": null, "scope": "SENDER", "limit": 500, "target": "STORAGE" } ], "data": null, "name": "Sandbox" }, "transactions": [], "created": "2016-05-05T19:30:13Z" } ], "logoUrl": "", "providers": null, "customFields": [ { "required": false, "id": "policy_number_id", "data": null, "translations": [ { "description": "Car Insurance Policy Number.", "language": "en", "id": "", "data": null, "name": "Policy Number" } ], "value": "123-456-789-0", "name": "" } ], "created": "2016-05-05T19:30:13Z", "owner": "ZQI8k6faVoM8", "name": "Haris Haidary" }, "title": "CEO", "external": null, "updated": "2017-11-20T18:36:02Z", "memberships": [], "phone": "", "professionalIdentityFields": [], "userCustomFields": [], "locked": null, "activated": null, "company": "ABC Bank", "email": "[email protected]", "firstName": "John", "lastName": "Smith", "type": "REGULAR", "name": "", "address": null, "created": "2017-11-20T18:36:02Z", "specialTypes": [], "hasDelegates": false }
Resending an Account Invitation
When a user is invited to join an account, they are sent an email which they must use to activate their account. The following code snippet illustrates how to re-send that email.
HTTP Request
POST /api/account/senders/{senderUid}/invite
HTTP Headers
Accept: application/json Content-Type: application/json Authorization: Basic api_key
Retrieving Users
You can also retrieve your senders:
HTTP Request
GET /api/account/senders?from=0&to=1
HTTP Headers
Accept: application/json Content-Type: application/json Authorization: Basic api_key
Request Payload
{ "results": [ { "status": "ACTIVE", "language": "en", "signature": null, "id": "IBCyHvarzWsX", "data": { "hasNotCreatedATransaction": true, "showIntro": true }, "account": { "id": "3vD0Dc9Fh7wQ", "created": "2016-05-05T19:30:13Z", "data": null, "company": { "id": "jVWmyg4cyis8", "data": null, "address": { "address1": null, "address2": null, "city": null, "country": null, "zipcode": null, "state": null }, "name": "OneSpan Sign" }, "updated": "2016-05-05T19:30:13Z", "licenses": [ { "status": "ACTIVE", "transactions": [], "created": "2016-05-05T19:30:13Z", "paidUntil": "2020-05-05T00:00:00Z", "plan": { "group": "", "description": "E-Sign Hundreds of Documents with Unlimited Signers", "id": "sandbox", "price": { "amount": 0, "currency": { "id": "USD", "data": null, "name": "US Dollar" } }, "original": null, "features": null, "data": null, "cycle": "YEAR", "contract": "YEAR", "freeCycles": null, "quotas": [ { "scope": "ACCOUNT", "cycle": null, "limit": 100, "target": "SENDER" }, { "scope": "SENDER", "cycle": null, "limit": 500, "target": "DOCUMENT" }, { "scope": "SENDER", "cycle": null, "limit": 500, "target": "STORAGE" } ], "name": "Sandbox" } } ], "logoUrl": "", "providers": null, "customFields": [ { "required": false, "id": "policy_number_id", "data": null, "translations": [ { "description": "Car Insurance Policy Number.", "language": "en", "id": "", "data": null, "name": "Policy Number" } ], "value": "123-456-789-0", "name": "" } ], "owner": "ZQI8k6faVoM8", "name": "Haris Haidary" }, "title": null, "activated": null, "company": "", "email": "[email protected]", "firstName": "Peter", "lastName": "Pan", "external": null, "updated": "2017-11-13T15:07:49Z", "memberships": [], "phone": "", "professionalIdentityFields": [], "userCustomFields": [], "locked": null, "address": null, "created": "2017-11-13T15:07:49Z", "name": "", "type": "REGULAR", "specialTypes": [], "hasDelegates": false }, { "status": "ACTIVE", "language": "en", "signature": null, "id": "2q37oSloj5AD", "data": { "hasNotCreatedATransaction": true, "showIntro": true }, "account": { "id": "3vD0Dc9Fh7wQ", "created": "2016-05-05T19:30:13Z", "data": null, "company": { "id": "jVWmyg4cyis8", "data": null, "address": { "address1": null, "address2": null, "city": null, "country": null, "zipcode": null, "state": null }, "name": "OneSpan Sign" }, "updated": "2016-05-05T19:30:13Z", "licenses": [ { "status": "ACTIVE", "transactions": [], "created": "2016-05-05T19:30:13Z", "paidUntil": "2020-05-05T00:00:00Z", "plan": { "group": "", "description": "E-Sign Hundreds of Documents with Unlimited Signers", "id": "sandbox", "price": { "amount": 0, "currency": { "id": "USD", "data": null, "name": "US Dollar" } }, "original": null, "features": null, "data": null, "cycle": "YEAR", "contract": "YEAR", "freeCycles": null, "quotas": [ { "scope": "ACCOUNT", "cycle": null, "limit": 100, "target": "SENDER" }, { "scope": "SENDER", "cycle": null, "limit": 500, "target": "DOCUMENT" }, { "scope": "SENDER", "cycle": null, "limit": 500, "target": "STORAGE" } ], "name": "Sandbox" } } ], "logoUrl": "", "providers": null, "customFields": [ { "required": false, "id": "policy_number_id", "data": null, "translations": [ { "description": "Car Insurance Policy Number.", "language": "en", "id": "", "data": null, "name": "Policy Number" } ], "value": "123-456-789-0", "name": "" } ], "owner": "ZQI8k6faVoM8", "name": "Haris Haidary" }, "title": null, "activated": null, "company": "", "email": "[email protected]", "firstName": "Mike", "lastName": "Smith", "external": null, "updated": "2017-11-13T15:07:49Z", "memberships": [], "phone": "", "professionalIdentityFields": [], "userCustomFields": [], "locked": null, "address": null, "created": "2017-11-13T15:07:50Z", "name": "", "type": "REGULAR", "specialTypes": [], "hasDelegates": false } ], "count": 8 }
Retrieving a Specific User
The following sample code helps you retrieve a specific user from an account.
HTTP Request
GET/api/account/senders/{senderId}
HTTP Headers
Accept: application/json Content-Type: application/json Authorization: Basic api_key
Request Payload
{ "status": "ACTIVE", "language": "en", "signature": null, "id": "IBCyHvarzWsX", "data": { "hasNotCreatedATransaction": true, "showIntro": true }, "account": { "id": "3vD0Dc9Fh7wQ", "data": null, "updated": "2016-05-05T19:30:13Z", "company": { "id": "jVWmyg4cyis8", "data": null, "address": { "address1": null, "address2": null, "city": null, "country": null, "zipcode": null, "state": null }, "name": "OneSpan Sign" }, "licenses": [ { "status": "ACTIVE", "paidUntil": "2020-05-05T00:00:00Z", "plan": { "group": "", "description": "E-Sign Hundreds of Documents with Unlimited Signers", "id": "sandbox", "features": null, "price": { "amount": 0, "currency": { "id": "USD", "data": null, "name": "US Dollar" } }, "original": null, "cycle": "YEAR", "contract": "YEAR", "freeCycles": null, "quotas": [ { "cycle": null, "scope": "ACCOUNT", "limit": 100, "target": "SENDER" }, { "cycle": null, "scope": "SENDER", "limit": 500, "target": "DOCUMENT" }, { "cycle": null, "scope": "SENDER", "limit": 500, "target": "STORAGE" } ], "data": null, "name": "Sandbox" }, "transactions": [], "created": "2016-05-05T19:30:13Z" } ], "logoUrl": "", "providers": null, "customFields": [ { "required": false, "id": "policy_number_id", "data": null, "translations": [ { "description": "Car Insurance Policy Number.", "language": "en", "id": "", "data": null, "name": "Policy Number" } ], "value": "123-456-789-0", "name": "" } ], "created": "2016-05-05T19:30:13Z", "owner": "ZQI8k6faVoM8", "name": "Haris Haidary" }, "title": "CEO", "external": null, "updated": "2017-11-13T15:07:49Z", "memberships": [], "phone": "", "professionalIdentityFields": [], "userCustomFields": [], "locked": null, "activated": null, "company": "ABC Bank", "email": "[email protected]", "firstName": "John", "lastName": "Smith", "type": "REGULAR", "name": "", "address": null, "created": "2017-11-13T15:07:49Z", "specialTypes": [], "hasDelegates": false }
Updating a User
To update a user you will need their user ID. Note that an email address cannot be updated once you’ve created your user. To change an email address you will need to create a new user.
HTTP Request
POST/api/account/senders/{senderId}
HTTP Headers
Accept: application/json Content-Type: application/json Authorization: Basic api_key
Request Payload
{ "firstName" : "John", "lastName" : "Smith", "company" : "XYZ Bank", "title" : "CEO", }
Deleting a User
To delete a user you will need their user ID. Here is some sample code that describes how to do this.
If your user has transactions already in their Inbox, or transactions in a Draft status, the user will be locked instead of deleted. They will not be able to create or send any other transactions.
HTTP Request
DELETE /api/account/senders/{senderId}
HTTP Headers
Accept: application/json Content-Type: application/json Authorization: Basic api_key
Retrieving the API KEY of a Sender
Below REST API shows you how to retrieve API KEY of your sender using account manager's authorization in request header.
HTTP Request
GET /api/account/senders/{senderId}/apiKey
HTTP Headers
Accept: application/json
Content-Type: application/json
Authorization: Basic api_key
Response Payload
{
"apiKey": "XXXXXXXXXXXXX=="
}
Sending a Transaction Using a Specific Sender
The sample code below shows you how to build a transaction to be sent by a specific user:
HTTP Request
POST /api/packages
HTTP Headers
Accept: application/json
Content-Type: multipart/form-data
Authorization: Basic api_key
Request Payload Table
For a complete description of each field, see this table:
Property | Type | Editable | Required | Default | Sample Values |
---|---|---|---|---|---|
status | string | Yes | No | INVITED | ACTIVE / INVITED / LOCKED |
string | Yes | No | n/a | [email protected] | |
firstName | string | Yes | No | n/a | John |
lastName | string | Yes | No | n/a | Smith |
company | string | Yes | No | n/a | ABC Bank |
title | string | Yes | No | n/a | CEO |
phoneNumber | string | Yes | No | n/a | +15256951122 |
------WebKitFormBoundary1bNO60n7FqP5WO4t Content-Disposition: form-data; name="file"; filename="testDocumentExtraction.pdf" Content-Type: application/pdf %PDF-1.5 %µµµµ 1 0 obj <>>> endobj.... ------WebKitFormBoundary1bNO60n7FqP5WO4t Content-Disposition: form-data; name="payload" { "sender": { "email": "[email protected]" }, "documents": [ { "extract": true, "name": "Contract" } ], "status": "DRAFT", "roles": [ { "id": "contractor", "type": "SENDER", "signers": [ { "email": "[email protected]", "firstName": "John", "lastName": "Smith", "id": "contractor" } ], "name": "contractor" }, { "id": "client", "type": "SIGNER", "signers": [ { "email": "[email protected]", "firstName": "Mary", "lastName": "Doe", "id": "client" } ], "name": "client" } ], "type": "PACKAGE", "name": "Cleaning Contract Example" }
Response Payload
{
"id": "9sKhW-h-qS9m6Ho3zRv3n2a-rkI="
}