kamranwali

(401) Unauthorized

0 votes

Hi, 

I am getting following error when I am trying to download Package Document Data.

Could not get the field summary. Exception: The remote server returned an error: (401) Unauthorized. HTTP GET on URI https://sandbox.esignlive.com/api/packages/7oigVuN4HbSlWkqnZEDpcZDv5iw=/fieldSummary. Optional details: {"messageKey":"error.unauthorised.noSession","message":"Failed to retrieve Session","code":401,"name":"Unauthorized"}

 

This is the code I am using to download data

IList<FieldSummary> fieldSummaries = ossClient.FieldSummaryService.GetFieldSummary(ossPackageId);

 

It has been working but now it is not working.

 

Please note that I am able to download documents and evidence summary for the package but only getting error when I am trying to download document data.

I am using same clientId and Secret for all the API calls, but somehow getting error on GetFieldSummary method.

 

I tried two different packages and got the same error.

 

Please have a look and suggest what the issue is.

 

Thanks,

Kamran

 

 


Reply to: (401) Unauthorized

0 votes

Hi Kamran,

 

Thanks for the information and I can reproduce the same error. I believe this is an .NET SDK issue that from OssClient.cs (source code here, line 150), the internal FieldSummaryApiClient always accepts API Key, instead of passing in the dynamic RestClient:

private void init(RestClient restClient, String apiKey)

{

......

fieldSummaryService = new FieldSummaryService(new FieldSummaryApiClient(apiKey, this.baseUrl));

......

}

 

If you preferred, I could raise a support ticket on your behalf and have the issue reported to R&D team.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: (401) Unauthorized

0 votes

Hi Duo,

 

Thanks for the reply, when I use Api key instead of clientid and secret it worked.

The issue is we have to use two types of authentication now, one for downloading the document data and other for all the other operations.

Yes If you can raise a ticket so that we can only use only type of authentication.

 

Thanks,

Kamran

 


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