Set User Roles in Subaccount
Thursday, December 29, 2022 at 09:12amWe have been able to use the Bulk Invite Sender Tool to bulk provision users. Is there a way once someone is created in OneSpan that I can programmatically assign their role within a subaccount.
Reply to: Set User Roles in Subaccount
Tuesday, January 3, 2023 at 09:49amHi Richard,
After some tests, I believe this method is introduced in .NET SDK 11.45 (The latest version is 11.49). Hence I believe you will either upgrade your SDK version, or implement the function in RESTful code.
Duo
Reply to: Set User Roles in Subaccount
Friday, December 30, 2022 at 08:15amHi Richard,
You can use below SDK method to assign account role to a sender:
ossClient.AccountService.assignAccountRoleToUser("0bbYsyszx2cB", UserAccountRoleBuilder.NewUserAccountRole()
.WithAccountId("sdkVZdIcvj0I")
.WithAccountRoles(new List<AccountRole> {
new AccountRole(){Id="member"},
new AccountRole(){Id="0c2cb422-f441-461e-a48f-64eb93369acb"}
}).Build());
Note that "0bbYsyszx2cB" is the sender ID, "sdkVZdIcvj0I" is the account/subaccount ID, and the "Id" is the minimal required field for AccountRole.
The API behind the scene is:
HTTP Request
POST /api/account/senders/{senderId}/roles ----without subaccount
POST /api/account/senders/{senderId}/account/{accountId}/roles ----with subaccount
HTTP Headers
Authorization: Basic {your_api_key}
Content-Type: application/json
Accept: application/json
Example Payload
[ { "id": "owner" }, { "id": "member" }, { "id": "manager" }, { "id": "dc996466-8a0a-40d2-a9fb-461de2c2fab7" } ]
Duo
Reply to: Set User Roles in Subaccount
Tuesday, January 3, 2023 at 07:50amI attempted to use the code but assignAccountRoleToUser doesn't appear to exist within the .NET library v11.34.1.0