An Account Event Handler is a way of allowing our system to notify your applications of activity on your account, for example the arrival of new messages in your Inbox or notification that a message has been delivered. It is a publicly accessible web page or web service that you develop and host for our system to post information to.
Account Events
Your account event handler will be notified of the following events:
- MessageReceived: A message received event will be sent when a message is received on your account
- MessageEvent: A message event is a delivery notification of a message that you have sent through the account
- MessageError: If a message fails after you have submitted it (e.g. the network operator could not deliver the message due to an error) then this notification will be sent.
- Subscription Events: If you have a premium rate account you will also be notified whenever someone subscribes to your service, sends a subsequent message in, or unsubscribes.
It is very important that your service handles each notification in at least a basic way. Even if you only want your application to react to inbound messages, your Account Event Handler will still be called for the other notification types.
A common error is assuming that your Account Event Handler will only be called when a message is received. This is not the case. If you do not check the notification type your Account Event Handler will end up processing message events and errors as if they were inbound message notifications.
Examples
The basic structure of how to implement an Account Event Handler has been written into our SDKs which are available for many programming languages.