Emma API Documentation

Triggers

NOTICE: Triggers have been deprecated.

These endpoints provide CRUD operations for our trigger system. Viewing a trigger is probably the most widely used of these operations.

GET /#account_id/triggers

Get a basic listing of all triggers in an account.

Sample Response [showhide]
GET /100/triggers

[
  {
    "parent_mailing": {
      "mailing_type": "m",
      "send_started": null,
      "signup_form_id": null,
      "mailing_id": 200,
      "plaintext": "Hello [% member:first_name %]!",
      "recipient_count": 0,
      "cancel_ts": null,
      "created_ts": "@D:2013-08-22T09:41:45",
      "month": null,
      "failure_ts": null,
      "year": null,
      "datacenter": null,
      "started_or_finished": null,
      "account_id": 100,
      "disabled": false,
      "mailing_status": "c",
      "plaintext_only": false,
      "sender": "Kevin McConnell",
      "parent_mailing_id": null,
      "failure_message": null,
      "name": "Sample Mailing",
      "send_finished": null,
      "cancel_by_user_id": null,
      "send_at": null,
      "reply_to": null,
      "subject": "Sample Mailing for [% member:first_name %] [% member:last_name %]",
      "purged_at": null,
      "archived_ts": null,
      "html_body": "<p>Hello [% member:first_name %]!</p>"
    },
    "surveys": null,
    "event_type": "r",
    "links": null,
    "field_id": 203,
    "signup_integrations": null,
    "push_offset_units": "0:-14:0:0",
    "start_ts": "@D:2013-08-22T09:41:45",
    "trigger_id": 100,
    "name": "Birthday triggers",
    "signups": null,
    "push_offset": "@I:-1209600.0",
    "groups": null,
    "parent_mailing_id": 200,
    "deleted_at": null,
    "is_disabled": false,
    "account_id": 100
  },
  {
    "parent_mailing": {
      "mailing_type": "m",
      "send_started": null,
      "signup_form_id": null,
      "mailing_id": 200,
      "plaintext": "Hello [% member:first_name %]!",
      "recipient_count": 0,
      "cancel_ts": null,
      "created_ts": "@D:2013-08-22T09:41:45",
      "month": null,
      "failure_ts": null,
      "year": null,
      "datacenter": null,
      "started_or_finished": null,
      "account_id": 100,
      "disabled": false,
      "mailing_status": "c",
      "plaintext_only": false,
      "sender": "Kevin McConnell",
      "parent_mailing_id": null,
      "failure_message": null,
      "name": "Sample Mailing",
      "send_finished": null,
      "cancel_by_user_id": null,
      "send_at": null,
      "reply_to": null,
      "subject": "Sample Mailing for [% member:first_name %] [% member:last_name %]",
      "purged_at": null,
      "archived_ts": null,
      "html_body": "<p>Hello [% member:first_name %]!</p>"
    },
    "surveys": null,
    "event_type": "s",
    "links": null,
    "field_id": null,
    "signup_integrations": null,
    "push_offset_units": "0:3:0:0",
    "start_ts": "@D:2013-08-22T09:41:45",
    "trigger_id": 101,
    "name": "Test Signup Form triggers",
    "signups": [
      1,
      2,
      3
    ],
    "push_offset": "@I:259200.0",
    "groups": null,
    "parent_mailing_id": 200,
    "deleted_at": null,
    "is_disabled": false,
    "account_id": 100
  }
]

GET /#account_id/triggers/#trigger_id

Look up a trigger by trigger id.

Returns :A trigger.
Raises :Http404 if no trigger is found.

Sample Response [showhide]
GET /100/triggers/100

{
  "parent_mailing": {
    "mailing_type": "m",
    "send_started": null,
    "signup_form_id": null,
    "mailing_id": 200,
    "plaintext": "Hello [% member:first_name %]!",
    "recipient_count": 0,
    "cancel_ts": null,
    "created_ts": "@D:2013-08-22T09:41:45",
    "month": null,
    "failure_ts": null,
    "year": null,
    "datacenter": null,
    "started_or_finished": null,
    "account_id": 100,
    "disabled": false,
    "mailing_status": "c",
    "plaintext_only": false,
    "sender": "Kevin McConnell",
    "parent_mailing_id": null,
    "failure_message": null,
    "name": "Sample Mailing",
    "send_finished": null,
    "cancel_by_user_id": null,
    "send_at": null,
    "reply_to": null,
    "subject": "Sample Mailing for [% member:first_name %] [% member:last_name %]",
    "purged_at": null,
    "archived_ts": null,
    "html_body": "<p>Hello [% member:first_name %]!</p>"
  },
  "surveys": null,
  "event_type": "r",
  "links": null,
  "field_id": 203,
  "signup_integrations": null,
  "push_offset_units": "0:-14:0:0",
  "start_ts": "@D:2013-08-22T09:41:45",
  "trigger_id": 100,
  "name": "Birthday triggers",
  "signups": null,
  "push_offset": "@I:-1209600.0",
  "groups": null,
  "parent_mailing_id": 200,
  "deleted_at": null,
  "is_disabled": false,
  "account_id": 100
}

PUT /#account_id/triggers/#trigger_id

Update or edit a trigger.

Returns :The id of the updated trigger.
Raises :Http404 if no trigger is found.

Sample Response [showhide]
PUT /100/triggers/100
{
  "name": "A Better Trigger"
}

100

DELETE /#account_id/triggers/#trigger_id

Delete a trigger.

Returns :True if the trigger is deleted.
Raises :Http404 if no trigger is found.

Sample Response [showhide]
DELETE /100/triggers/100

true

GET /#account_id/triggers/#trigger_id/mailings

Get mailings sent by a trigger.

Returns :An array of mailings.
Raises :Http404 if no trigger is found.

Sample Response [showhide]
GET /100/triggers/101/mailings

[
  {
    "mailing_type": "m",
    "send_started": null,
    "signup_form_id": null,
    "mailing_id": 200,
    "plaintext": "Hello [% member:first_name %]!",
    "recipient_count": 0,
    "cancel_ts": null,
    "created_ts": "@D:2013-08-22T09:41:45",
    "month": null,
    "failure_ts": null,
    "year": null,
    "datacenter": null,
    "started_or_finished": null,
    "account_id": 100,
    "disabled": false,
    "mailing_status": "c",
    "plaintext_only": false,
    "sender": "Kevin McConnell",
    "parent_mailing_id": null,
    "failure_message": null,
    "name": "Sample Mailing",
    "send_finished": null,
    "cancel_by_user_id": null,
    "send_at": null,
    "reply_to": null,
    "subject": "Sample Mailing for [% member:first_name %] [% member:last_name %]",
    "purged_at": null,
    "archived_ts": null,
    "html_body": "<p>Hello [% member:first_name %]!</p>"
  }
]

Related Topics

Interested in Emma?

Emma's email marketing makes communicating simple and stylish. Get started today.