mcho | Posts: 16

downloading sub account's documents

0 votes

Hello,

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.


Duo_Liang | Posts: 3776

Reply to: downloading sub account's documents

0 votes

Hi 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


mcho | Posts: 16

Reply to: downloading sub account's documents

0 votes

Thank 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?


mcho | Posts: 16

Reply to: downloading sub account's documents

0 votes

Thank you Duo.


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off