Is there a golang example of subscribing to the Notifications API?

I have written an entire application in node.js / javascript that I am working on porting over to golang. I have REST API calls to the Platform API working fine, but I'm struggling a bit to work with the Notifications API using the platforemclientv2 package.

Can anyone point me to an example for golang?

Thanks!

Hi,

We haven't yet added support for notifications in the Golang SDK. The best example at the moment would be taking a look at how the CLI subscribes to notifications.
listenchannel.go has the functionality required for subscribing to a channel and printing the messages to STDOUT when provided with a channelId.

Installation information for the CLI can be found on the developer centre.

To create a channel and listen to it using the CLI, firstly run

gc notifications channels create

Fetch the id from the response and use

gc notifications channels listen [CHANNEL_ID]

to subscribe to the websocket.

Thank you - this should get me started!

Hi Dan,

While we don't have anything immediately available, I am going to talk to one of our team members and see if we can throw some Golang examples. Thanks and we can go from there. Also, we are getting ready to post a devdrop walking through the API, but using Python. Keep your eyes out for that

Thanks,
John Carnell

1 Like

Any news on a Notifications API example for Golang?

Thanks,
Dan

I managed to get my code connected to the Notifications API in Golang. I'll post it here for anyone else who needs it after I clean it up a little bit and get it subscribed to a topic. Stay tuned...

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