Push Notifications is a feature of our Messaging Platform that can notify your applications of activity on your Account e.g. the arrival of new Messages in your Inbox or Notification that a Message has been delivered. It requires a publicly accessible web page or web service that you host which Esendex posts information about the Notification to.
Our Push Notifications are delivered across the Internet as HTTP POST requests so you'll need to host your Push Notifications Handler code on a publicly accessible web server. This could be your own server or one provided by a hosting company. Our Quickstart page provides example code for setting up a Push Notification Handler.
In order to receive Notifications you will need to write a Handler to process the XML that is sent by Esendex and respond with an HTTP Status Code of 200. If an HTTP Status Code of 200 is not received (e.g. if your Handler is unavailable for any reason) then a Notification will be retried again for the next 72 hours. All Inbound Messages are delivered to the Account Inbox regardless of whether the Push Notification has been successfully handled by your Push Notifications Handler.
To configure the public URL to access your Push Notifications Handler on your Account:
You can test the three types of Push Notification in the following ways:
Note: Any outbound activity from Account, including failed Messages, will incur a Message charge
When an Account's Message Received Notification is setup with a valid public URL, Esendex will HTTP POST the following XML to your Push Notifications Handler:
<InboundMessage>
<Id>{push-notification-id}</Id>
<MessageId>{inbound-message-id}</MessageId>
<AccountId>{esendex-account-id}</AccountId>
<MessageText>{Message text of inbound message}</MessageText>
<From>{phone number of sender of the message}</From>
<To>{Virtual Mobile Number of your Account}</To>
</InboundMessage>
When an Account's Message Delivered Notification is setup with a valid public URL, Esendex will HTTP POST the following XML to your Push Notifications Handler:
<MessageDelivered>
<Id>{push-notification-id}</Id>
<MessageId>{inbound-message-id}</MessageId>
<AccountId>{esendex-account-id}</AccountId>
<OccurredAt>
{the UTC DateTime (yyyy-MM-ddThh:mm:ss) the message was delivered}
</OccurredAt>
</MessageDelivered>
When an Account's Message Failed Notification is setup with a valid public URL, Esendex will HTTP POST the following XML to your Push Notifications Handler:
<MessageFailed>
<Id>{push-notification-id}</Id>
<MessageId>{inbound-message-id}</MessageId>
<AccountId>{esendex-account-id}</AccountId>
<OccurredAt>
{the UTC DateTime (yyyy-MM-ddThh:mm:ss) the message was delivered}
</OccurredAt>
</MessageFailed>
Our Messaging Platform supports, and we encourage the use of, SSL encrypted communication between it and your Push Notifications Handler through the use of a certificate certified by one of the well know Root Authorities, e.g. VeriSign, Thawte, etc.