Create Package in multiple sub accounts using API KEY
Monday, November 15, 2021 at 05:00amI have access to three Sub Account.
I can create package inside any of the sub accounts in UI.
If i create a package through API it will be created inside my home sub account
How to create package in different sub account using API for a particular user as sender
Reply to: Create Package in multiple sub accounts using API KEY
Monday, November 15, 2021 at 08:39amHi Sohan,
I think this question is right about time! Because in OneSpan Sign's latest release 11.45 (release note here), it introduced a new account role's permission named "Manage users’ transactions, templates, layouts (API)"
Fow now, Admin role won't carry this permission by default, hence you might want to:
(1) Create a customized role with all the necessary permissions + this one and assign the role to you.
(2) Get your API Keys in each of these three subaccounts. The most straightforward way is through the sender UI > Admin menu > API Access, or if your account has sufficient permissions (User Management, Sub Account Management and Api Access), you can retrieve your own API Keys via this call:
GET /api/account/subaccountApiKeys
(3) In order to create transactions in different subaccounts for a particular user as sender, use the corresponding API Key for this subaccount as the authentication, and add "sender" node to the request payload, I will use a standard package creation API for example:
HTTP Request
POST /api/packages
HTTP Headers
Authorization: Basic api_key / Bearer access_token
Accept: application/json
Content-Type: multipart/form-data
Request Payload
{
"roles": [
{
"id": "Role1",
"signers": [
{
"email": "[email protected]",
"firstName": "1.firstname",
"lastName": "1.lastname",
"company": "OneSpan Sign"
}
]
}
],
"documents": [
{
"approvals": [
{
"role": "Role1",
"fields": [
{
"page": 0,
"top": 100,
"subtype": "FULLNAME",
"height": 50,
"left": 100,
"width": 200,
"type": "SIGNATURE"
}
]
}
],
"name": "Test Document"
}
],
"name": "Example Package",
"language": "en",
"description": "New Package",
"status": "SENT",
"sender": {
"email": "sender's email"
}
}
(4) Sender with this permission will have API Access to view and edit other sender's packages, as long as you've obtained the package ID:
GET/PUT /api/packages/{packageId}
(5)Similarly, in order to bulk retrieve other senders' packages, you'd use the corresponding API Key for this subaccount as the authentication, and use an additional parameter "ownerEmail/ownerUserId" in the package retrieval API:
GET /api/[email protected]&from=1&to=100
Duo
Reply to: Hi Sohan, I think this…
Monday, November 15, 2021 at 09:18amThank you Duo for the quick reply!!
I will try this