Did you ever wondering if it was possible to build your own Sametime Mobile application ?
Two things here :
there isn't any "mobile" SDK, like the one we provide to create sametime bots in java, or sametime connect plugins
you can not directly interact with the Sametime mobile application from another application.
So how can you build your own application ? Well, exactly like our own mobile application : by using the sametime proxy.
The Sametime Proxy
The Sametime Proxy is one of the several servers available in Sametime Communicate or Sametime Complete. Its role is to act as a proxy between a browser and the community server. Basically, it transforms HTTP methods (GET, PUT, DELETE, etc) into VP protocol, the protocol used by Sametime Community Server.
It is bundled with a Sametime Proxy Web application that customers can customize in every way they want. They can also explode it into several pieces, in order to integrate the contact list in their intranet for instance, or to add Sametime awareness to every name in their applications or intranet (this is what we used in IBM Connections for sametime integration)
In a hybrid mobile application (using IBM Worklight), we can easily imagine a webcontainer which will display the customized web application. It is obviously the most simple use case.
The REST API
But all of these dojo API are based on a lower-level API, the REST API.
Each time you connect to the server, you send a message, you set your status, you receive a message,etc. there is a HTTP dialog with the proxy server. And because most languages are able to open a socket a send HTTP command to a server, you can write a Sametime client in any language you want, including of course cocoa for iPhone/iPad or java/python for android.
All you have to do is to read the Proxy toolkit guide (included in Sametime SDK)
Because every query in Sametime is asynchronous, while the HTTP protocol is synchronous by nature, you will have to understand a few things.
1/ The first thing to do is to authenticate on Proxy Server.
POST https://<proxy_server>/stwebapi/user/connect HTTP/1.1
You will have to post your username and your password. You should receive here a sessionID (burried in the JSON response)
2/ Once you get a sessionID, you will have to get a special token called "RTC4Web-Nonce"
GET https://<proxy_server>/stwebapi/RTCServlet/<sessionID>/user?userName=<your_username>&method=put HTTP/1.1
You shoud get the RTC4Web-Nonce in the JSON response.
3/ Remember the asynchronous problem ? Now that we have our RTC4Web-Nonce, we can start a nearly infinite loop in a separate thread (otherwise the program will hang) to this url in order to be notified of incomings events. You will have to provide the RTC4Web-Nonce as a HTTP Header in each of these requests
GET https://<proxy_server>/stwebapi/RTCServlet?format=json&dojo.preventCache=<timestamp> HTTP/1.1
note: I have an error (400) in my python program when I'm not setting the dojo.preventCache parameter to a random value, while it is supposed to be optional
Two possibilies here :
a timeout occurs and we can ignore it then process to the same request again
the proxy server is responding. This occurs when something happens, such a message received, or someone who has just open a new chat window with us, someone who is typing some text, etc.
In the latest case, the JSON response contains anything we need, such the author of the message, his CN (LDAP common name), the message content, and so on.
Last but not least if you want to send a message to someone, you will have to get its CN first (there is several ways to do that), your message content, and then post these values to this URL :
POST https://<proxy_server>/stwebapi/chat HTTP/1.1
(with userId set to the recipient userId and msg set to the message you want to send.)
Then we can properly destroy our session then disconnect from server (you will remain online for a while if you do not disconnect properly) :
PUT https://<proxy_server>/stwebapi/RTCServlet/<sessionID>/endUpdate HTTP/1.1
DELETE https://<proxy_server>/stwebapi/RTCServlet/<sessionID>/user?username=<username>&broadcast=false HTTP/1.1
And that's it !
As you can see, it's pretty easy to implement, but you will have many other information in the toolkit guide, in order to retrieve & manage contact list for instance, or change your status.
Also be aware that, even if the webclient provided with the proxy is able to make audio/video calls, and even if our mobile application is also able to make audio/video calls, it is NOT possible to do the same thing using pure REST APIs. And there is no documentation yet for this purpose.
My python sample script is available here for download (just update SERVER, USERNAME, and PASSWORD according to your needs)