Delegate Access

This guide will show you how to delegate access your OneSpan Sign account to your senders.

OneSpan Sign gives you the ability to delegate senders access to your account. The delegates will have access to the account holder’s inbox, drafts, layouts, and templates. They will also have the capability of signing documents in your stead. It is important to note that all transactions made by the delegates are still owned by the delegator.

The Code

To delegate access from the UI, go ahead and login to your OneSpan Sign account. Click on your name in the toolbar and select “My Account” from the drop-down menu. From the menu on the left-hand side, select “Access Delegation”. Here, you have the ability to add and remove delegates from your account. Please note that to add a delegate, the user has to be a sender in your account.

Capture

If you are not able to add delegates, they are likely not enabled on your account. Please contact our support team at sign.support@onespan.com to enable this feature.

OneSpan Sign gives you the ability to delegate senders access to your account. The delegates will have access to the account holder’s inbox, drafts, layouts, and templates. They will also have the capability of signing documents in your stead. It is important to note that all transactions made by the delegates are still owned by the delegator.

The Code

The first step is to retrieve all senders in your OneSpan Sign account. The code below shows you how to retrieve your signers, which comes as a page from OneSpan Sign, along with their emails and ids. The sender ids will be required in order to add/remove delegates. In the code below, the number of senders returned in the PageRequest is set to 5. The maximum number of senders that you can retrieve per page is 50. The first value in the PageRequest (variable ‘i’) is the starting point in the overall list of senders that should be returned. This variable is incremented as we step through our senders to keep track of where we are in the overall group of senders.

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));
}

To add a delegate, you will need to retrieve your sender using your OneSpan Sign AccountService. A sender id, like the one retrieved in the last step, is required to retrieve a particular sender. Once you have your sender, you then build your DelegationUser object and call your OneSpan Sign client AccountService to add your delegate. Your user id is required to add delegates. Much like the senderId you used above to get your sender, the code above will get you that.

Sender user1 =  client.getAccountService().getSender(sender1Id);
DelegationUser delegationUser1 = DelegationUserBuilder.newDelegationUser(user1).build();
client.getAccountService().addDelegate(ownerId, delegationUser1);

To remove a delegate, you simply call on your OneSpan Sign client AccountService. Similar to adding delegates, you will need your user id and the sender id.

client.getAccountService().removeDelegate(ownerId, sender1Id);

You can also do a bulk update of your delegates list. Doing so will clear all of your current delegates and replace them with the ones defined in your list. To do this, all you need to do is create a list of delegate IDs and use the AccountService to update your delegates.

List<String> delegateIds = new ArrayList<String>();
delegateIds.add(sender1Id);
delegateIds.add(sender2Id);
delegateIds.add(sender3Id);
        
client.getAccountService().updateDelegates(ownerId, delegateIds);

If you would like to know who is already a delegate on your account, you can access those, in list form with the following AccountService call.

List<DelegationUser> delegates = client.getAccountService().getDelegates(ownerId);
int  i = 1;
for(DelegationUser delegate : delegates) {
      System.out.println("Delegate " + i + ": " + delegate.getName() + ", with email " + delegate.getEmail());
      i++;
}

Finally, if you wish to clear all of your delegates, the following line will accomplish that. Again, you will need your user id.

client.getAccountService().clearDelegates(ownerId);

Running Your Code

Included in this guide was the code that grabbed your senders’ email and id.

Capture

Furthermore, the output the code that retrieved your current list of delegates, which prints out their full name and email, is shown below.

Capture

Lastly, you will find below your list of users that can manage your transactions in your OneSpan Sign account.

Capture

Get the Code

OneSpan Sign gives you the ability to delegate senders access to your account. The delegates will have access to the account holder’s inbox, drafts, layouts, and templates. They will also have the capability of signing documents in your stead. It is important to note that all transactions made by the delegates are still owned by the delegator.

The Code

The first step is to retrieve all senders in your OneSpan Sign account. The code below shows you how to retrieve your signers, which comes as a page from OneSpan Sign, along with their emails and ids. The sender ids will be required in order to add/remove delegates. In the code below, the number of senders returned in the PageRequest is set to 5. The maximum number of senders that you can retrieve per page is 50. The first value in the PageRequest (variable ‘i’) is the starting point in the overall list of senders that should be returned. This variable is incremented as we step through our senders to keep track of where we are in the overall group of senders.

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));
        }

To add a delegate, you will need to retrieve your sender using your OneSpan Sign AccountService. A sender id, like the one retrieved in the last step, is required to retrieve a particular sender. Once you have your sender, you then build your DelegationUser object and call your OneSpan Sign client AccountService to add your delegate. Your user id is required to add delegates. Much like the senderId you used above to get your sender, the code above will get you that.

Sender user1 = client.AccountService.GetSender(sender1Id);
DelegationUser delegationUser1 = DelegationUserBuilder.NewDelegationUser(user1).Build();
client.AccountService.AddDelegate(ownerId, delegationUser1);

To remove a delegate, you simply call on your OneSpan Sign client AccountService. Similar to adding delegates, you will need your user id and the sender id.

client.AccountService.RemoveDelegate(ownerId, sender1Id);

You can also do a bulk update of your delegates list. Doing so will clear all of your current delegates and replace them with the ones defined in your list. To do this, all you need to do is create a list of delegate IDs and use the AccountService to update your delegates.

List<string> delegateIds = new List<string>();
delegateIds.Add(sender1Id);
delegateIds.Add(sender2Id);
delegateIds.Add(sender3Id);

client.AccountService.UpdateDelegates(ownerId, delegateIds);

If you would like to know who is already a delegate on your account, you can access those, in list form with the following AccountService call.

IList<DelegationUser> delegates = client.AccountService.GetDelegates(ownerId);
int i = 1;

foreach (var user in delegates){
     Debug.WriteLine("Delegate " + i + ": " + user.Name + " with email " + user.Email);
     i++;
}

Finally, if you wish to clear all of your delegates, the following line will accomplish that. Again, you will need your user id.

client.AccountService.ClearDelegates(ownerId);

Running Your Code

Included in this guide was the code that grabbed your senders’ email and id.

Capture

Furthermore, the output the code that retrieved your current list of delegates, which prints out their full name and email, is shown below.

Capture

Lastly, you will find below your list of users that can manage your transactions in your OneSpan Sign account.

Capture

Get the Code

OneSpan Sign gives you the ability to delegate senders access to your account. The delegates will have access to the account holder’s inbox, drafts, layouts, and templates. They will also have the capability of signing documents in your stead. It is important to note that all transactions made by the delegates are still owned by the delegator.

The Code

The first step is to retrieve all senders in your OneSpan Sign account.

HTTP Request
GET /api/account/senders?from=0&to=100

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

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

Response Payload

{
  "results": [
    {
      "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": null,
      "external": null,
      "updated": "2017-11-13T15:07:49Z",
      "memberships": [],
      "phone": "",
      "professionalIdentityFields": [],
      "userCustomFields": [],
      "locked": null,
      "activated": null,
      "company": "",
      "email": "mail73@mailinator.com",
      "firstName": "John",
      "lastName": "Smith",
      "type": "REGULAR",
      "name": "",
      "address": null,
      "created": "2017-11-13T15:07:49Z",
      "specialTypes": [],
      "hasDelegates": false
    }
  ],
  "count": 1
}

To add a delegate, you will need to retrieve your sender ids, which you can get from the call above. To add delegate, you will need to make the following request:

HTTP Request
PUT /api/account/senders/{senderId}/delegates

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

Request Payload

["delegateSenderId"]

Similar to adding delegates, you will need your sender ids to remove a delegate. To do so, you simply make:

HTTP Request
DELETE /api/account/senders/{senderId}/delegates

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

Request Payload

["delegateSenderId"]

You can also do a bulk update of your delegates list. Doing so will clear all of your current delegates and replace them with the ones defined in your list.

HTTP Request
PUT /api/account/senders/{senderId}/delegates

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

["delegateSenderId1","delegateSenderId2", "delegateSenderId3"]

If you would like to know who is already a delegate on your account, you can access those:

HTTP Request
GET /api/account/senders/{senderId}/delegates

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

Response Payload

[
  {
    "email": "mary.doe@example.com",
    "firstName": "Mary",
    "lastName": "Doe",
    "id": "bYDFWxGOYmAV",
    "data": null,
    "name": "Mary Doe"
  },
  {
    "email": "john.smith@example.com",
    "firstName": "John",
    "lastName": "Smith",
    "id": "T3AY60Ev33o0",
    "data": null,
    "name": "John Smith"
  }
]

Lastly, you will find below your list of users that can manage your transactions in your OneSpan Sign account.

Capture

Get the Code