How do Events work in the Sonos Cloud API? - sonos

Various parts of the Sonos Cloud API include subscribe/unsubscribe calls, but I don't see any example of how those events get delivered to the caller. What am I missing?

The documentation for how to subscribe to and handle events can be found here.

Related

Assigning webhooks to Firebase Messaging "subscribe to topic" event

In my current project I am using the Kreait Firebase PHP SDK to send out push notifications to Android & iOS devices that have subscribed to notifications on named topics. No issues thus far. However, rather than have fixed topic names I would now like to generate topic names based on the current "condition" of the connecting device. The condition could, for example, be a geographic location.
This is not too difficult either and I have modified my app to handle this. However, in order to put the ability to have such autogenerated topics to use I need to know the topic names on my server so I can send out targeted messages via Kreait. I find Google's Firebase documentation a bit dense at times and have not been able to establish whether it is possible to assign webhooks that get called by Firebase whenever a SubscribeToTopic, UnsubscribeFromTopic event occurs.
A simple question - does FCM even offer anything like this capability? If so, any pointers to the relevant documentation would be much appreciated.
There is no public API to get a list of topic names from Firebase, nor is there a way to hook into the subscription mechanism.
Your best bet is to simply make two calls when a user subscribes to a topic: one to Firebase, and one to your own backend API that keeps a list of active topics/conditions.

Sonos Cloud API Queues

I want to develop a Sonos Controller that is capable of:
Playing a playlist or album now, or next (after currently playing song) or by appending it to the end of the queue.
However I can't see a way to control how the playlist is added to a queue. The documentation at https://developer.sonos.com/reference/control-api/playlists/loadplaylist/ doesn't suggest that it is possible,but there is a reference to the queue in the description for the shuffle playmode "Play the tracks in the queue in a randomly shuffled order."
There is documentation for "Cloud Queues" but this seems to be targeted at Music Services.
Is it possible to create a Cloud Queue that just holds references to tracks in other services?
Not that I would really want to implement that, I would rather just access the queue that is on the players.
The Sonos Control API does not currently allow for direct access to the player queue. Third party integrations can get content on to the queue via the playlists and favorites namespaces, but they can't touch the queue directly.
As you noted, the Cloud Queue API is intended for Content Partners. It is not directly possible to reference third party content in personal CQs, there are authentication issues involved.
This squares with my user experience of the Sonos queue being very basic and unintelligent. There have been a number of times I've been forced to clear the queue and start over, rather than being able to reorder items, etc. FWIW, the closest thing I've seen in their documentation to what it sounds like you're looking for, is under a different API. Sonos Music API > reorderContainer as documented here: https://developer.sonos.com/reference/sonos-music-api/reordercontainer/
I don't see any similar functionality documented in the Sonos Cloud Queue API. With regard to random order, I believe that's on playback, not anything that modifies the queue.

Getting RTCpeerconnection object of participants in twilio video api

I need to implement signalling between peers in a many to many video conference.
To do that i need access to the RTC Data Channel.
Since "Twilio Video API" doesn't yet provide Data Channel, should I use "Twilio Conversations API" for this task as it provides access to the RTCPeerConnection Object which can be used to create data channels which i found over here:
Or is there a way to get the RTCPeerConnection object of other peers in "Twilio Video API" itself?
Twilio developer evangelist here.
The Twilio Conversations API is deprecated so you should not use that.
There's no official way to get access to the RTCPeerConnection object within the Video API. I haven't found an unofficial way yet myself (though I'm sure there is, given that JavaScript doesn't really have private methods/properties).
If you definitely need the RTCDataChannel itself then you might not want to build with the Twilio Video API.
However, if you are looking to signal between peers, then perhaps the Twilio Sync API, which is a real time API for syncing data between clients and works really well alongside Twilio Video, can help.

Does the AtTask API support project and issue webhooks?

I noctice there are document webhooks in AtTask, but do you support / plan to support webhooks that are triggered when a particular event or action takes places with respect to Projects or issues?
Currently there is no support for Webhooks outside of the document Webhooks. This is something we are looking into but do not have a timetable of release.

Implementing Facebook's Like feature using Google Cloud Messaging

I have a use case to implement a 'like' feature for messages using GCM. One approach that comes to mind is to make each post a 'topic' and then send all likes on a post as a separate GCM message on that topic.
However, in order to achieve this, the client has to register for each topic corresponding to the post that it has loaded on the UI in real time. This brings me to the following questions:
This is approach right?
How long will it take for a client's subscription to a topic to reflect at GCM's end? Same for unsubscription?
Can I get a list of all subscribers to a given topic?