Error calling ListStatusChanges in DocuSing SDK

22 views Asked by At

I am using the DocuSign API v:6.8.0 in a .Net application.

I can manage to get the authenticationtoken and also the userInfo. But when I try to get a list of envelopes, I alway get this error: "Error calling ListStatusChanges". Using Postman however I do manage to get envelops and even documents inside of the envelops.

In C# this is how I try to get the envelops:

//Get User Info
DocuSign.eSign.Client.Auth.OAuth.UserInfo userInfo = _apiClient.GetUserInfo(authToken.access_token);

var account = userInfo.Accounts[0];

var baseUri = account.BaseUri + "/restapi";
//Instantiate new API Client
_apiClient = new DocuSignClient(baseUri);
//Configure API Client. Provide authentication information
_apiClient.Configuration.DefaultHeader.Add("Authorization", "Bearer " + authToken.access_token);

//Create Envelopes API and get Envelops
var envelopsApi = new EnvelopesApi(_apiClient);

//Get EnvelopId
DateTime fDate = new DateTime(2024, 1, 1);
DateTime tDate = new DateTime(2025, 12, 31);
var listStatusChangesOptions = new ListStatusChangesOptions();
listStatusChangesOptions.fromDate = fDate.ToString("yyyy-MM-ddTHH:mm:ssZ");
listStatusChangesOptions.toDate = tDate.ToString("yyyy-MM-ddTHH:mm:ssZ");
var envelops = envelopsApi.ListStatusChanges(account.AccountId, listStatusChangesOptions);

If I am not mistaken the ListSatusChangesOptions that is mandatory if no other is given is "fromDat". But even after adding that and even "toDate" or "Status", I keep getting the same error. And there is also no additional information in the error itself, so I do not know where to look.

Can somebody help please? Thank you in advance.

1

There are 1 answers

2
Inbar Gazit On

I tried to run your code and it worked just fine. My guess is your issue has to do with authentication, getting the right account information etc.

If your code and configuration to get the access token is incorrect - that may result in an error.

I would suggest downloading a quickstart C# code (full option on the right) and trying the code example that does exactly this and you'll be able to get it working.