Verifying a channel still exists and is valid

In the API documentation there's a call to validate that an existing notification channel is valid.

https://developer.genesys.cloud/api/rest/v2/notifications/#head-api-v2-notifications-channels--channelId-

Upon looking through the code for the C# implementation of the API, I didn't see that call implemented. After implementing it myself I noticed that no data is returned in the reply and only a 200 is sent. In the API definition is states that a boolean will be returned.

Here is the request:

HEAD https://api.usw2.pure.cloud/api/v2/notifications/channels/streaming-"removed"
HTTP/1.1
Accept: application/json
Authorization: Bearer "removed"
Host: api.usw2.pure.cloud

Reply

HTTP/1.1 200 OK
Content-Type: application/json
Connection: keep-alive
Content-Encoding: gzip
Expires: 0

Is this API functioning properly? Or was it excluded from the C# implementation because there is an issue?

Hi Clark,

The call to HeadNotificationsChannel(channelId) should be in the SDK and is documented here: https://developer.genesys.cloud/api/rest/client-libraries/dotnet/NotificationsApi#headnotificationschannel. I don't have Visual Studio so can't load up the library. If it truly isn't in the library then we can open a case to get that addressed.

As for the boolean return, my guess is that our underlying implementation of that API, which are docs are based on, probably does return a boolean true/false, but the HTTP HEAD verb is designed to only return HTTP headers and not the actual payload like an HTTP GET does (https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD). So you will likely never get the boolean value returned, but an HTTP 200 OK should imply a success that the channel is valid, otherwise you'd get an HTTP 404 returned.

Clark,

I installed Visual Studio on my Mac today and was able to confirm that the Genesys Cloud Platform SDK available via NuGet does contain the HeadNotificationsChannel() method and that method, when called, doesn't return a boolean due to it being a HEAD verb that doesn't return a payload.

FWIW, it's here in the source: https://github.com/MyPureCloud/platform-client-sdk-dotnet/blob/86319ea6a95322c738871eb49615088bbde2bc5d/build/src/PureCloudPlatform.Client.V2/Api/NotificationsApi.cs#L1243

Could you open a case with Genesys Cloud Care to report this issue? API resources are expected to behave in accordance with the documentation; this is a bug.

Ticket has been opened.

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