mikcanf | Posts: 71

AccountService Class instantiation

0 votes

Sender sdr = new Sender();
AccountService accountService = new AccountService();
sdr = accountService.GetSender("##########");

Trying to instantiate accountService causes CS1729 'AccountService' does not contain a constructer that takes 0 arguments. There is no info in Object browser indicating what are possible constructors for "AccountService" class.


Duo_Liang | Posts: 3776

Reply to: AccountService Class instantiation

0 votes

Hi Mike,

 

If you are trying to retrieve a sender per sender ID, try using this .NET sdk function instead:

            sdr = eslClient.AccountService.GetSender("##########");
The AccountService, or ApprovalService, PackageService, etc are singleton classes and only exposes through eslClient.

 

Duo


mikcanf | Posts: 71

Reply to: AccountService Class instantiation

0 votes

Hi Duo, thx for suggestion.  Challenge is, when using Object browser I don't see anything like eslClient.  Closest thing I see would be OssClient, which allows for an APIkey connection.

I d/l Sdk below from www.nuget.org and it says latest version ( 11.39.0 )

using OneSpanSign.Sdk;
using OneSpanSign.API;
using OneSpanSign.Sdk.Builder;
using OneSpanSign.Sdk.Builder.Internal;
using OneSpanSign.Sdk.Internal;
using OneSpanSign.Sdk.Internal.Conversion;
using OneSpanSign.Sdk.Services;


Duo_Liang | Posts: 3776

Reply to:

0 votes

Hi Mike,

 

Yeah, we rebranded the .NET SDK since 11.31, and rename EslClient as OssClient (If you were checking our feature guides where most .NET sample code are still using the old .NET SDK, wherever you can't directly find the class name, you could simply modify "esl" to "oss", "eSignLive" to "OneSpanSign"). Back to the topic, you could use below code snippet instead:      

      OssClient ossClient = new OssClient(apiKey, apiUrl);
      Sender sdr = ossClient.AccountService.GetSender("##########");

 

Duo


mikcanf | Posts: 71

Reply to: AccountService Class instantiation

0 votes

Thx Duo, your suggestions above worked out.
I am trying to update sender (SBX only)
There is a Senderinfo class (6 properties/fields)
and a Sender class (15 properties/fields)

Even though method below says "UpdateSender", it only updates using SenderInfo class,
AccountService.UpdateSender(sdrinfo, "############");
I can't seem to find method that will update all 15 Sender properties

Is there another way to update all 15 Sender properties?

Do I need to create new class, inherit/extend?


Duo_Liang | Posts: 3776

Reply to: AccountService Class instantiation

0 votes

Hi Mike,

 

SDK can only updates 6 properties in SenderInfo class. Below are all 15 properties in Sender class, and 4 of them are not able to update using SDK:

//not able to change

private SenderStatus status;        //LOCKED, INVITED, ACTIVE

private SenderType type;             //REGULAR, MANAGER

private string language;

private string phone;

 

//enable to change

private string firstName;

private string lastName;

private string company;

private string title;

private string timezoneId;

 

//not necessary to change

private Nullable<DateTime> created;

private External external;

private Nullable<DateTime> updated;

private string email;

private string id;

private string name;

 

Is it an one-time operation or you want to bring this capability to your application? If the former, you can either log onto sender's portal and update from their respectively portal, or use my bulk sender update tool where my tool reads sender data from a CSV file and updates their sender profile in bulk. Otherwise if you want to extend your application, you might have to invoke an additional POST call using HTTPClient instead of using the SDK function. (example code in this guide could be a good reference)

 

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