Visit our Google Group
Discuss with other developers, get support and leave us feedback.

Receiving Events

Events are posted to your callback url whenever your users interact with Zeep via their phone or our settings panel. The Content-type of the POST is application/x-www-form-urlencoded. This means you can treat it almost exactly as if it were a form post from a web page. The only difference you'll notice is in how you respond.

Each post will contain an argument named event. The value of which tells you what type of mobile event you are receiving and which arguments will be present.

In most cases, if you receive an event from us your user is expecting a response. You must respond to every mobile-event with an HTTP 200 within 30 seconds of receiving it. The Content-type of the response should always be text/plain. Unless otherwise stated, anything you return in the body of the response will be sent directly to your users phone.

We do not want to keep your user waiting for a response. If an error occurs we will send them this message "<your app name> is experiencing technical difficulties, please try again later." Keep in mind we consider it an error if your server responds with any status code other than 200, takes longer than 30 seconds to respond or uses the wrong Content-type.

SUBSCRIPTION_UPDATE

This event is sent to you when a user subscribers to your app in our panel or changes their mobile phone number. Your response should welcome them to your app.

Arguments

uid The user id you passed to us in the settings panel
min User's mobile device number in e164 format

Example Post

POST /api/send_message HTTP/1.1
Host: zeepmobile.com
Authorization: Zeep cef7a046258082993759bade995b3ae8:XGPPx8+Me8RBoEUTPO6LSiSLDn4=
Date: Tue, 06 Jan 2009 02:59:57 GMT
Content-Type: application/x-www-form-urlencoded
Content-Length: 72
event=SUBSCRIPTION_UPDATE&uid=joeblow@zeepmobile.com&min=+1555555555

Example Response

200 OK
Date: Tue, 06 Jan 2009 02:59:57 GMT
Content-Type: text/plain
Content-Length: 18
Welcome to my app!

MO

MO stands for "Mobile Originated". This event is sent to you when a user texts "<your sms prefix> [some message]" to 88147. You are free to respond to this any way you see fit.

Arguments

uid The user id you passed to us in the settings panel.
sms_prefix Your app's current SMS Prefix
message The rest of the message.

Example Post

POST /api/send_message HTTP/1.1
Host: zeepmobile.com
...
Content-Type: application/x-www-form-urlencoded
Content-Length: 54
event=MO&uid=joeblow@zeepmobile.com&message=Hello!

Example Response

200 OK
Date: Tue, 06 Jan 2009 02:59:57 GMT
Content-Type: text/plain
Content-Length: 7
Hi Joe!