Documentation → Offline Messages
Overview
Offline messages occur when a user sends a message to another user who is not currently online. These messages are queued in our servers until the other user comes back online or for 5 minutes if you enable offline message integration. These offline message archives are available to you via a callback API that is implemented on your end. This API is hit with a payload on an interval of every 30 seconds to deliver the messages that occurred since the last interval. This process will attempt to hit the callback for a total of 5 times giving a window of 2 min and 30 seconds to obtain a successful connection to your callback. If delivery of the payload is unsuccessful it will discard the messages from the Userplane queue. This delivery is done in the form of an XML packet as post data delivered over HTTP. Userplane will attempt to send you this data 3 times or until we have successfully hit your API endpoint with a status code of 200. The callback method involved is sendArchive and details on how to implement can be found below:
Capture messages sent to users who are offline
sendOfflineMessages( domainID, type, callID )
Sends a list of offline messages. This method will be called every 60 seconds but will only include data that is older than 5 minutes.
sendOfflineMessages looks very similar to the sendArchive format for 1:1 archive bundles. Offline messages only exist for 1:1 chat.
<td > function
| Arguments |
Value |
| sendOfflineMessages |
| domainID |
The identifier for the domain the user is on. |
| callID |
A unique identifier for this XML call. |
| xmlData |
A FORM variable that contains the archive data (example shown below). |
XML Sample Format
This request is made as a FORM POST (all parameters are still on the query string, though) and a single FORM element of ‘xmlData’ is sent in the following fo
<?xml version='1.0' encoding='utf-8'?>
<messageOffline type="chat" callID="123123">
<room>
<name><![CDATA[asfd]]></name>
<messages>
<entry type="leave">
<timestamp>1126551110781</timestamp>
<userID invisible="false">1</userID>
</entry>
<entry type="join">
<timestamp>1126551112343</timestamp>
<userID invisible="false">1</userID>
</entry>
<entry type="msg">
<timestamp>1126551127685</timestamp>
<userID invisible="false">1</userID>
<content><![CDATA[this is my message]]></content>
</entry>
</messages>
</room>
</messageOffline>