downloading sub account's documents
Wednesday, August 5, 2020 at 11:10pmHello,
I would like to find out how I can download document generated by a sender in the sub account when only API key I have is the owner's from the top most level. If anyone has an example in c# code, that would be great.
Reply to: downloading sub account's documents
Thursday, August 6, 2020 at 04:24pmHi Mark,
Sorry for the late reply, since subaccount is still an evolving feature, we are still keeping learning its capability.
From my experience, if you've turned on the subaccount feature, the owner of the top most level no longer have the total access of all packages. Instead, you need to retrieve sender's API Key or API Token first, then use this credential to download the package.
It seems only IF you invited the sender at the main account level (this is not distinguishable from UI), then you can
(1)either grab sender's API Key using Owner A's API Key:
GET /api/sender/{senderId}/apiKey
This is less SDK friendly, you need to implement the API yourself
(2)or register a Client App ID + Secret Pair at main account level, and build the OssClient in this way:
string API_BASE_URL = "https://sandbox.esignlive.com";
ApiTokenConfig config = new ApiTokenConfig();
config.BaseUrl = API_BASE_URL;
config.ClientAppId = "1734e2cb2xxx88120d009c";
config.ClientAppSecret = "6879647261c88064xxx5577510fd50e2110ccf0c7a0890ae2";
config.SenderEmail = "your_sender_email";
config.TokenType = ApiTokenType.SENDER;
OssClient ossClient = new OssClient(config, API_BASE_URL + "/api", false, null, new Dictionary<string, string>());
As you may noticed, EslClient has been renamed as OssClient since .NET SDK 11.33, read this blog about the necessary steps to upgrade your SDK.
Also read this blog for more information about API Token.
Duo
Reply to: downloading sub account's documents
Thursday, August 6, 2020 at 04:34pmThank you Duo. Just a quick question. Does that code work for users under subaccounts too? Do I have to registee different apps for each sub account?
Reply to: downloading sub account's documents
Thursday, August 6, 2020 at 04:36pmHi Mark,
You also need to register a pair at your sender portal, main account level.
My blog OneSpan Sign Release 11.34: API Token for Client Application has the detailed steps there.
Duo
Reply to: downloading sub account's documents
Thursday, August 6, 2020 at 05:37pmThank you Duo.