The RESP command requests the webservice, through POST, retrieve the list of new messages.
By implementing an asynchronous communication process with webservice (POST), the device must send the CHCK command about each minute. The response from the CHCK command will return the list of new messages and the hash of the channels list.
If the channel list hash has been modified since the last check, the device must send the command LSUB to update the channel list of the local base. The hash obtained in the verification must be stored in the local base, so it could be compared to the hash obtained in the next requests, and thus keep the list of channels updated.
The channel list obtained in the webservice response includes the hash of each channel icon. If any hash is different from the local base, the APP should request the updated icon with the ICON command.
The messages have the sequence number attribute (Message-ID), which identifies each message in Followzup. The code of the last message received in the CHCK command must also be stored in the local base of the device, to be informed at the next check. If the device does not inform the Message-ID correctly, the device will receive messages previously sent.
|id||Contains the identification of the Device, no encrypted (Device-ID)|
|key||Contains the temporary AES key encrypted with the public key and encoded in Base64;|
|frame||Contains the XML request, encrypted with the temporary AES key and encoded in Base64.|
In response to the POST, the webservice returns the XML POST response, which should not mistaken with the XML request response, as described below. The POST response XML includes 3 tags:
<?xml version="1.0" encoding="utf-8"?> <followzup> <retcode>return-code</retcode> <retframe>xml-request-response</retframe> <retmd5>md5-hash</retmd5> </followzup>
<?xml version="1.0" encoding="utf-8"?> <followzup> <stp>stamp</stp> <com>chck</com> <seq>sequence</seq> <msg>Message-ID</msg> </followzup>
<?xml version="1.0" encoding="utf-8"?> <followzup> <md5>md5-channel-list</md5> <msg>channel-tag;Message-ID;datetime;msg-text;msg-url</msg> <msg>...</msg> </followzup>
XML request response (invalid sequence):
<?xml version="1.0" encoding="utf-8"?> <followzup> <seq>Last-sequence</seq> </followzup>
|7999||Webservice under maintenance|