Click here to Skip to main content
15,884,838 members
Articles / Programming Languages / Java

Send an IM with UCWA - Hints, Tips & Extra Goodies - Learn More

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
31 Jan 2015CPOL1 min read 5K   1  
How to send and IM with UCWA

This is part 5 of a 5 part series.

Keep Alive

UCWA will automatically shut down Applications and Conversations after a few minutes, if it does not receive a 'Keep Alive' signal from the client in a timely fashion. Whilst any IM or other activity will trigger this cycle, in circumstances where there are no IMs being sent frequently, a 'Keep Alive' must be sent to maintain an active application.

In my experience, I've found sending this 'Keep Alive' every 3 minutes (180 seconds) during idle times is sufficient.

Important: For a 'Keep Alive' to work, the Application must be in the Available state with an active conversation. If you have not already sent an IM, but wish to send a 'Keep Alive', simply set the availability state by specify the modality of messages. You can use the HTML Messages code below this section to achieve exactly this (with or without the ,HTML component of the JSON data).

Triggering a Keep Alive is performed by a single POST to the interface.

POST /ucwa/oauth/v1/applications/12345678/me/reportMyActivity

No POST data is required.

HTML Messages

By default, UCWA will send Instant Messages as plain text. You can, however, add HTML as a modality in order to send rich text messages via IM.

This is achieved by a single POST to the interface.

POST /ucwa/oauth/v1/applications/12345678/me/makeMeAvailable

With the POST data being:

Java
{"SupportedModalities":["Messaging"],"supportedMessageFormats":["Plain","Html"]}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO Kutamo and ErrLog.IO
Australia Australia
Pluralsight Author, .Net Developer, Writer & Blogger

http://www.kutamo.com/
http://www.errlog.io/
http://www.matthewproctor.com/
http://www.pluralsight.com/author/matthew-proctor

I am an Australian IT professional based in Melbourne, Victoria, Australia.

I'm a polyglot programmer, being proficient in a number of languages and frameworks including C#, VB.Net, F#, Javascript, Perl, Powershell and Z80 & 6502 assembly. Smile | :)

Comments and Discussions

 
-- There are no messages in this forum --