We've been using our own build of SDK so far - it allowed us to add some things and fix issues. I had another look at what's published on Github recently and was delighted to find that all my proposed changes had been integrated and that the project had been migrated to SDK style project. So I figured I'd give the Nuget another try. Only to fail miserably. I then downloaded the latest source code, compiled and ran my own code with my own build - which worked just fine.
So, I'm having two issues with the v224 nuget (both are fine if I make my own build)
- All requests are made without the access token. I see that the authentication request goes to /oauth/token instead of /token (the build on Github goes to /token). Both get a response, but on subsequent requests, the Nuget build does not send a token header whereas my own build does. Natuarlly, without the token header being present, every request I make after login gets me something like this:
{"message":"No authentication bearer token specified in authorization header.","code":"authentication.required","status":401,"contextId":"d4f3ee67-800d-4ec3-a8ae-1a2b9930dff9","details":[],"errors":[]}
Here's my authentication code
var accessTokenInfo = client.PostToken(clientId, clientSecret);
Initially I thought I must have missed a breaking change, but since things are fine when I make my own build, it seems that the published Nuget is from some other code.
- Setting a ConfigFilePath throws a Nullpointer exception. Here's how I'm using it
configuration = new Configuration();
client = configuration.ApiClient;
PureCloudRegionHosts region = PureCloudRegionHosts.eu_central_1;
client.setBasePath(region);
configuration.ConfigFilePath = "genesysConfig.json";
It's the last line that causes the problem. The stacktrace of the exception is
at PureCloudPlatform.Client.V2.Client.Configuration.ConfigurationParser.getJsonString(String section, String key)
And the contents of the genesysConfig.json
file is
{
"logging": {
"log_level": "trace",
"log_format": "text",
"log_to_console": true,
"log_file_path": "c:\\temp\\genesys.log",
"log_response_body": true,
"log_request_body": true
},
"retry": {
"retry_wait_min": 3,
"retry_wait_max": 10,
"retry_max": 5
},
"reauthentication": {
"refresh_access_token": true,
"refresh_token_wait_max": 10
},
"general": {
"live_reload_config": true,
"host": "https://api.mypurecloud.de"
}
}
So, what's going on here? I can of course keep using our own builds, but I'm at a loss why the published Nuget works differently from my own build (downloaded the source code from Github yesterday)