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, Func
2 selector)
at PureCloudPlatform.Client.V2.Client.ApiClient.CallApi(String path, Method method, List1 queryParams, Object postBody, Dictionary
2 headerParams, Dictionary2 formParams, Dictionary
2 fileParams, Dictionary2 pathParams, String contentType) at PureCloudPlatform.Client.V2.Api.RoutingApi.GetRoutingSkillsWithHttpInfo(Nullable
1 pageSize, Nullable1 pageNumber, String name, List
1 id)
at PureCloudPlatform.Client.V2.Api.RoutingApi.GetRoutingSkills(Nullable1 pageSize, Nullable
1 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