REST API: Presence

Both users and queues have presence. Presence refers to the availability of a user or queue for chat. LibraryH3lp uses the XMPP (Jabber) protocol for chat, which definies the following valid responses for presence:

  • chat (actively interested in chatting)
  • available
  • dnd (do no disturb)
  • away (temporarily away)
  • xa (extended away)
  • unavailable

Via the Presence API, presence query responses are available in text, XML, JavaScript, and image formats.

Authentication

No authentication is required to retrieve presence because responses contain no sensitive information.

HTTP and HTTPS

Presence requests are served over both HTTP and HTTPS.

Presence Resource

Resource URI

/presence/jid/{name}/[chat.]libraryh3lp.com/{format}[/{theme}]

name

{name} is an user's username or a queue's name. If {name} is a user's username, then you must omit the optional [chat.]. However if {name} is a queue's name, you must include the optional [chat.].

format

{format} specifies the format for the presence indicator and can be either text, xml, js, or image.

theme (optional)

You may optionally specify a theme when choosing image for {format}. There are a variety of themes available, each with its unique icon set for presence. If not specified, {theme} defaults to simpletext.

HTTP GET

text example

GET /presence/jid/mycc-support/chat.libraryh3lp.com/text
available

XML example

GET /presence/jid/mycc-support/chat.libraryh3lp.com/xml
<presence user="mycc-support" server="chat.libraryh3lp.com">
  <resource show="available" name="libraryh3lp" priority="5"/>
</presence>

JavaScript example

GET /presence/jid/mycc-support/chat.libraryh3lp.com/js
var jabber_user='mycc-support';
var jabber_server='chat.libraryh3lp.com';
var jabber_resources=[{
   name: 'libraryh3lp',
   priority: 5,
   show: 'available',
   status: ''
}];
var jabber_client_id='k2rsu9blwu8myb';

image example

GET /presence/jid/mycc-support/chat.libraryh3lp.com/image