Skip to content

Instantly share code, notes, and snippets.

@danielfone
Created May 25, 2014 23:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielfone/c0c3d3b6ba61ca836037 to your computer and use it in GitHub Desktop.
Save danielfone/c0c3d3b6ba61ca836037 to your computer and use it in GitHub Desktop.
JSON API
//
//-- Create a subscriber
//
// POST /api/my-brand/subscribers
{
"subscriber": {
"name": "Test Subscriber",
"email": "test@example.com",
"subscribe": [
'my-list-1',
'my-list-2'
],
"channel_data": {
"smtp": {
// email and name will be inferred from above
"preferred_format": "html"
},
"sms": {
"phone": "555 123 456"
}
},
"extra_data": {
"birthday": "2014-05-26",
"gender": "M"
}
}
}
//
//-- Add subscription
//
// POST /api/my-brand/subscribers
{
"subscriber": {
"email": "test@example.com",
"subscribe": [
'a-different-list'
],
}
}
//
//-- Unsubscribe
//
// POST /api/my-brand/subscribers
{
"subscriber": {
"email": "test@example.com",
"unsubscribe": ['yet-another-list'],
}
}
//
//-- Record a bounce
//
// POST /api/my-brand/subscribers
{
"subscriber": {
"email": "test@example.com",
"channel_data": {
"smtp": {
"bounced": "2014-05-26T10:45:24+12:00"
},
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment