Using the twilio javascript client I can register a client like that:
capability.AllowClientIncoming("jenny");
Now let's say I have a number of people opening their browser and registering: "jenny", "benny", "teddy", "smitty"...
Is there a way I can list all the registered clients? Either with the twilio.js library or the REST API?
Twilio Evangelist here.
So you can use the Twilio.Device.presence() handler for this. It will be called once for each other client user, so you can create a list from that. If the state of any of the other client agents changes, the handler is called again.
Twilio.Device.presence(function (presenceEvent) {
console.log(presenceEvent.from + " available: " + presenceEvent.available;
});
There is a page to describe this feature on the Twilio Blog too. Lots more information on the Twilio Docs page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With