Email Notification API
These emails are automatically sent out to either you or the customer. When you use Web Hooks to manage mobile orders in your traditional online shop, you may want to turn zubibu email notifications off. You can do this either in zubibu backend or through API.
Get all email notifications
GET /emails.:format
This method requires authentication
Example
$ curl http://api.zubibu.com/v1/emails.json?api_key=API_KEY
Response
HTTP/1.1 200 OK
[
{
"created_at": "2011-07-30T22:08:34+02:00",
"updated_at": "2011-07-30T22:08:34+02:00",
"topic": "order/paid",
"id": "4e307195ab78b486b7000050",
"email_description": "payment notification (sent to account owner)",
"active": true
},
{
"created_at": "2011-07-30T22:10:35+02:00",
"updated_at": "2011-07-30T22:10:35+02:00",
"topic": "order/paid",
"id": "4e307195ab78b486b7000051",
"email_description": "payment confirmation (sent to customer)",
"active": true
},
{
"created_at": "2011-07-30T22:11:45+02:00",
"updated_at": "2011-07-30T22:11:45+02:00",
"topic": "order/cancelled",
"id": "4e307195ab78b486b7000052",
"email_description": "order cancellation notification",
"active": false
},
{
"created_at": 2011-07-30T22:14:23+02:00,
"updated_at": "2011-07-30T22:14:23+02:00",
"topic": "order/dispatched",
"id": "4e307195ab78b486b7000053",
"email_description": "order fulfillment notification",
"active": false
}
]
Get only active (or inactive) email notifications
GET /emails.:format?active=true|false
This method requires authentication
Example
$ curl http://api.zubibu.com/v1/emails.json?api_key=API_KEY&active=true
Response
HTTP/1.1 200 OK
[
{
"created_at": "2011-07-30T22:08:34+02:00",
"updated_at": "2011-07-30T22:08:34+02:00",
"topic": "order/paid",
"id": "4e307195ab78b486b7000050",
"email_description": "payment notification (sent to account owner)",
"active": true
},
{
"created_at": "2011-07-30T22:10:35+02:00",
"updated_at": "2011-07-30T22:10:35+02:00",
"topic": "order/paid",
"id": "4e307195ab78b486b7000051",
"email_description": "payment confirmation (sent to customer)",
"active": true
}
]
Get a single email notifications
GET /emails/:email_id.:format
This method requires authentication
Example
$ curl http://api.zubibu.com/v1/emails/4e307195ab78b486b7000050.json?api_key=API_KEY
Response
HTTP/1.1 200 OK
{
"created_at": "2011-07-30T22:08:34+02:00",
"updated_at": "2011-07-30T22:08:34+02:00",
"topic": "order/paid",
"id": "4e307195ab78b486b7000050",
"email_description": "payment notification (sent to account owner)",
"active": true
}
Activate an email notifications
PUT /emails/:email_id/activate.:format
This method requires authentication
Example
$ curl -X PUT http://api.zubibu.com/v1/emails/4e307195ab78b486b7000050/activate.json?api_key=API_KEY
Response
HTTP/1.1 200 OK
{
"created_at": "2011-07-30T22:08:34+02:00",
"updated_at": "2011-07-30T22:08:34+02:00",
"topic": "order/paid",
"id": "4e307195ab78b486b7000050",
"email_description": "payment notification (sent to account owner)",
"active": true
}
Deactivate an email notifications
PUT /emails/:email_id/deactivate.:format
This method requires authentication
Example
$ curl -X PUT http://api.zubibu.com/v1/emails/4e307195ab78b486b7000050/deactivate.json?api_key=API_KEY
Response
HTTP/1.1 200 OK
{
"created_at": "2011-07-30T22:08:34+02:00",
"updated_at": "2011-07-30T22:08:34+02:00",
"topic": "order/paid",
"id": "4e307195ab78b486b7000050",
"email_description": "payment notification (sent to account owner)",
"active": false
}
