API example to populate presence panel

67 views
Skip to first unread message

Eric Hernaez

unread,
Nov 19, 2013, 12:17:06 AM11/19/13
to netsapiens-de...@googlegroups.com
Chris,

Can you please provide the API call necessary to emulate the User's presence panel in MP.  That is all users in the same domain with status.

Thanks

Chris Aaker

unread,
Nov 19, 2013, 10:55:06 AM11/19/13
to Eric Hernaez, netsapiens-de...@googlegroups.com
This is a two step process. First step is to get the user list and current status. this is pretty easy, you will want to use object "presence" and action "list". This can be done form nearly any scope. You will also need to add in the domain filter, but that should be the only filter needed. This will return a small field set for all the users in the domain including first, lastname, username, current status message, and current presence value matching the presence value shown in the admin portal (open, closed, inuse, busy, etc..). You will need to match the values and draw your panel from there. 

As for live data you will need to "subscribe" to the api using the "events" object and action "create". You will need to give the following settings, domain, model ("presense"), post_url which will be a full url where the API will post changes to your app and an optional "expires" field (default is expires time of the token used). 

From there the API in partnership with a node.js server will stream changes to the url given. The results will be in JSON. 

Chris



--
You received this message because you are subscribed to the Google Groups "NetSapiens Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netsapiens-develope...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--

Chris Aaker

NetSapiens Inc.
920 Kline St. #400, La Jolla, CA 92037
Phone: +1 (866) 4-VOIP-IQ x5226 Direct: +1 (858) 764-5226
Email: caa...@netsapiens.com gChat- c.a...@gmail.com
Reply all
Reply to author
Forward
0 new messages