Clark | 2021-07-21 16:57:35 UTC | #1
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?
crespino | 2021-07-21 17:58:07 UTC | #2
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.
crespino | 2021-07-21 19:20:44 UTC | #3
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.
tim.smith | 2021-07-21 19:25:34 UTC | #4
crespino, post:2, topic:11537
If it truly isn't in the library then we can open a case to get that addressed.
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
tim.smith | 2021-07-21 19:28:31 UTC | #5
Clark, post:1, topic:11537
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.
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.
crespino | 2021-07-21 21:21:56 UTC | #6
Ticket has been opened.
system | 2021-08-21 21:21:57 UTC | #7
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 11537