Update SDK Nuggets to latest version (183)

Hello,

I'm trying to migrate our SDK version from 175.2.0 to 183 but it doesn't work (as version 183 is very recent, I tested it with 182 and the result was the same). Indeed, switching to this version causes an error on all API calls. For example:

Unhandled exception: System.ArgumentNullException: Value cannot be null. (Parameter 'source')
at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable1 source, Func2 selector)
at PureCloudPlatform.Client.V2.Client.ApiClient.CallApi(String path, Method method, List1 queryParams, Object postBody, Dictionary2 headerParams, Dictionary2 formParams, Dictionary2 fileParams, Dictionary2 pathParams, String contentType) at PureCloudPlatform.Client.V2.Api.RoutingApi.GetRoutingSkillsWithHttpInfo(Nullable1 pageSize, Nullable1 pageNumber, String name, List1 id)
at PureCloudPlatform.Client.V2.Api.RoutingApi.GetRoutingSkills(Nullable1 pageSize, Nullable1 pageNumber, String name, List`1 id)

Hre is the code that we use to configure and call the API:

var apiClient = Configuration.Default.ApiClient;
var region = PureCloudRegionHosts.eu_central_1;
apiClient.setBasePath(region);

var proxyName = _configuration["ProxyName"];
if (!string.IsNullOrEmpty(proxyName))
{
apiClient.ClientOptions.Proxy = new WebProxy(proxyName, true); // Was apiClient.RestClient.Proxy = new WebProxy(proxyName, true); in version 175.2.0
}

var retryConfig = new ApiClient.RetryConfiguration
{
MaxRetryTimeSec = 5,
RetryMax = 2
};
apiClient.RetryConfig = retryConfig;

Configuration.Default.Logger.Level = env.IsProduction() ? LogLevel.LError : LogLevel.LTrace;
Configuration.Default.Logger.Format = LogFormat.JSON;
Configuration.Default.Logger.LogRequestBody = true;
Configuration.Default.Logger.LogResponseBody = true;
Configuration.Default.Logger.LogToConsole = false;

var logFile = _configuration["PureCloudLogFile"];
if (!string.IsNullOrEmpty(logFile))
{
if (!File.Exists(logFile))
{
File.CreateText(logFile);
}
Configuration.Default.Logger.LogFilePath = logFile;
}

apiClient.PostToken(_configuration["ClientId"], _configuration["ClientSecret"]);

new RoutingApi().GetRoutingSkills(pageSize: size, pageNumber: number);

The log genrerated by the SDK are:

{"date":"2023-07-21T09:26:32.7864293Z","level":"trace","method":"Post","url":"xxxxx://login.mypurecloud.de/token","requestHeaders":{"Accept":"application/json","Authorization":"[REDACTED]"},"responseHeaders":{"Date":"Fri, 21 Jul 2023 09:26:32 GMT","Connection":"keep-alive","Inin-Correlation-Id":"a325664e-b744-46ea-4db8-25070531c5a3","Strict-Transport-Security":"max-age=7776000","Vary":"Accept-Encoding"},"statusCode":200}
{"date":"2023-07-21T09:26:32.9668623Z","level":"debug","method":"Post","url":"xxxxx://login.mypurecloud.de/token","requestHeaders":{"Accept":"application/json","Authorization":"[REDACTED]"},"correlationId":"","statusCode":200}
{"date":"2023-07-21T09:27:08.8517877Z","level":"debug","method":"Get","url":"xxxxx://api.mypurecloud.de/api/v2/routing/queues?pageNumber=1&pageSize=25","requestHeaders":{"Accept":"application/json","Authorization":"[REDACTED]"},"correlationId":"","statusCode":0}
{"date":"2023-07-21T09:27:08.8517879Z","level":"debug","method":"Get","url":"xxxxx://api.mypurecloud.de/api/v2/routing/skills?pageSize=25&pageNumber=1","requestHeaders":{"Accept":"application/json","Authorization":"[REDACTED]"},"correlationId":"","statusCode":0}

(I've replaced https with xxxxx so that the forum doesn't think I'm posting links.)

Is there a problem with the way we call APIs via the SDK that worked in old version but is not compatibel with the new one, or is there a bug in the new SDK version?

Thanks

Hi.

Trying to replicate this problem with the configuration you added. Will post here shortly.

Hi Julien

Based on the status code it could be a broken connection or timeout with the Proxy. We are going to make an update for this .

Will send out the release version once done.

Hi @Julien_Sander

A new Nugget version 184 is released now. Can you check if you are still seeing the issue with this.

BR
Hemanth

Hi

Thank you for the information. Unfortunately, I get the same behavior with the version 184 of the nugget:

{"date":"2023-07-27T06:56:55.6175043Z","level":"debug","method":"Get","url":"https://api.mypurecloud.de/api/v2/routing/skills?pageSize=25&pageNumber=1","requestHeaders":{"Accept":"application/json","Authorization":"[REDACTED]"},"correlationId":"","statusCode":0}

Regards,
Julien

Hi

Can you run the API without Proxy. Is it possible ? Just want to eliminate some cases if it is problem/not a problem with Proxy. Also can you let me know if there is any timeout configured at your side ?

Hi

I cant' run API without proxy as there is firewall that block every outbound request that does not pass through the entreprise proxy.

I don't have configured a timeout on my side.

To try to analyse the issue, I use à sniffer and I see that for the token request, the proxy receive correctly the request but for the api call there is no request reaches the proxy.

Regards
Julien

Hi

The version 184 will make sure, all the API requests you make go through the proxy if configured. Weird that you still face issue with the broken connection,

Can I get some more details like the version of .NET and Mono version you are using

Is it possible I can give you a snapshot DLL for PlatformClient with some more logging and changes and you can use this snapshot version in your environment ?

and also I would like to add a simple client code CLI which interacts with the PlatformClient which runs in my environment . You can run it in your env , so that we can eliminate any env specific problems that might be causing this.

Best Regards
Hemanth

Hello

I'm using .Net version 6.0 and I don't use mono.

I'm going on vacation tonight but I'll be available when I get back the week of August 7 to do some tests.

Regards
Julien

Hi @Julien_Sander
I got a exe file with some log info added which we can share and run on a win os or if you use mac let me know I will change the executable. We can hop on a call on Tuesday and try to mitigate this. (Monday is a bank Holiday in Ireland)

Hi,

I tried with the 184.2.0 and it works fine.

Regards
Julien

Thanks for the Update Julien

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.