This action is designed for receiving new messages from any Hardware in your account as quickly as possible; therefore it's limited to returning a maximum of 200 messages at a time. If you need to retrieve historical messages for a given period, use DataMt/GetMessages instead.
Action will return all messages after specified lastMessageRetrieved - if there's no newer messages, the service will wait up to maxPollTime for new messages, before returning - as such the response may contain no messages.
If lastMessageRetrieved is not supplied, this action will return the latest message.
This mechanism facilitates "long-polling" - avoiding the need to continuously poll and reduces latency.
Example Flow (LMR = Last Message Retrieved)
- Initial Request - no LMR parameter is submitted as last message is unknown
- Server returns most recent Message (provided in LMR response field)
- Client makes follow-on request, this time supplying above LMR value
- Server will immediately return any new messages since LMR (if available, maximum 200)
- If no new messages, service will wait up to maxPollTime for new messages
- Service will return as soon as a new Message is received
- If no new Messages after maxPollTime - Service will return an empty response
- Client Repeat - Goto 3
It's important that you correctly configure http client timeouts to facilitate the specified maxPollTime