If you would like to integrate Enormail in your CMS or CRM solution this is a good point to start. At this moment we only have a PHP API wrapper available but we expect the community to release wrappers sooner or later for other languages. (Yes we mean you ...)

The PHP wrapper is the quickest way to access our API. Drop it in your project and start coding right away.


GitHub


Install with composer

  • version 1.1
    • Added contact tags
    • Updated webforms

  • version 1.0
    • Initial release

Before you can use our API you have to create an API key. Go to the manage api section in your Enormail account and create a new API key.

Create API key

Authenitifcation

The Enormail API uses HTTP Basic Authentication to authenticate requests. When you make an API request you provide your API key as the username and the password portion can be blank or a dummy value, as it is not used for API authentication.

To test if your connection to our API is working properly you can access our API directly through your browser.

https://api.enormail.eu/api/1.0/ping.json

It should return (JSON format)

{ping : hello}

That's it! You're done. Proceed to our code examples and start the magic...

api-

Success

Request Response
GET Will return a "200 OK" response if the resource is successfully retrieved.
POST Will return a "201 Created" response if the resource is successfully created or a "200 OK" response when the request has been successfully executed.
PUT Will return a "200 Ok" response if the resource is successfully updated.
DELETE Will return a "200 OK" response if the resource is successfully deleted.

Errors

Code Error
400 Bad request Will return when the request is malformed.
401 Unauthorized Will return when authentification is missing or blocked.
404 Not found Will return when the resource is not found.
429 Request limit reached Our API has a rate limit of 5 requests per second per account. If an error occurs, please stop execution for at least 1,000 milliseconds before submitting your request.
500 Internal server error Will return when something bad has happened at our side. Please contact support.

Retrieves information about the accessed Enormail user account.

Account info

GET https://api.enormail.eu/api/1.0/account.{json|xml}

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "id": "1a1a1a1a1a1a1a1a1a1a1a1a1a1a",
    "firstname": "John",
    "lastname": "Tester",
    "email": "test@example.com",
    "created_at": "20130131025915",
    "lastlogin_at": "20130217162025"
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <id>1a1a1a1a1a1a1a1a1a1a1a1a1a1a</id>
    <firstname>John</firstname>
    <lastname>Tester</lastname>
    <email>test@example.com</email>
    <created_at>20130131025915</created_at>
    <lastlogin_at>20130217162025</lastlogin_at>
</response>

Senders

Retrieves a list of allowed senders for the accessed account.

GET https://api.enormail.eu/api/1.0/account/senders.{json|xml}

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  "sender-1@example.com",
  "sender-2@example.com",
  "sender-3@example.com"
]
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <sender>sender-1@example.com</sender>
    <sender>sender-2@example.com</sender>
    <sender>sender-3@example.com</sender>
</response>

Manage your lists and list details.

Getting lists

GET https://api.enormail.eu/api/1.0/lists.{json|xml}?page={page}

Params

Name Type Description
page integer Pagination page

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
    {
        "listid":"27a989a1aeab2b96cedd2b6c4a7cba2f",
        "title":"Bounce rule test",
        "weight":"1",
        "total_confirmed":"3",
        "total_unconfirmed":"0",
        "total_unsubscribed":"8",
        "created_at":"20120213112023",
        "modified_at":"20120213112023"
    },
    {
        "listid":"3834e6081af73a9608a25be3c410478c",
        "title":"Test import lijst",
        "weight":"2",
        "total_confirmed":"644",
        "total_unconfirmed":"0",
        "total_unsubscribed":"1",
        "created_at":"20120826205819",
        "modified_at":"20120826205819"
    },
]
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <list>
        <listid>27a989a1aeab2b96cedd2b6c4a7cba2f</listid>
        <title>Example list 1</title>
        <weight>1</weight>
        <total_confirmed>3</total_confirmed>
        <total_unconfirmed>0</total_unconfirmed>
        <total_unsubscribed>8</total_unsubscribed>
        <created_at>20120213112023</created_at>
        <modified_at>20120213112023</modified_at>
    </list>
    <list>
        <listid>ad5asd5asd5asd8as8das58d6d5as7d</listid>
        <title>Example list 2</title>
        <weight>1</weight>
        <total_confirmed>2</total_confirmed>
        <total_unconfirmed>0</total_unconfirmed>
        <total_unsubscribed>0</total_unsubscribed>
        <created_at>20120213112023</created_at>
        <modified_at>20120213112023</modified_at>
    </list>
</response>

List details

Retrieves list details.

GET https://api.enormail.eu/api/1.0/lists/{listid}.{json|xml}

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "listid":"27a989a1aeab2b96cedd2b6c4a7cba2f",
    "title":"Bounce rule test",
    "weight":1,
    "total_confirmed": 3,
    "total_unconfirmed":0,
    "total_unsubscribed":8,
    "total_bounced":4,
    "created_at":"20120213112023",
    "modified_at":"20120213112023"
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <list>
        <listid>27a989a1aeab2b96cedd2b6c4a7cba2f</listid>
        <title>Example list 1</title>
        <weight>1</weight>
        <total_confirmed>3</total_confirmed>
        <total_unconfirmed>0</total_unconfirmed>
        <total_unsubscribed>8</total_unsubscribed>
        <total_bounced>4</total_bounced>
        <created_at>20120213112023</created_at>
        <modified_at>20120213112023</modified_at>
    </list>
</response>

Create a new list

Creates a new list to import and subscribe contacts to. Upon success you will receive a location header to the newly created resource.

POST https://api.enormail.eu/api/1.0/lists.{json|xml}

Params

Name Type Description
title varchar(150) Title of the list
send_mail_subscribe tinyint(1) 1 or 0 send mail when a new contact subscribes
send_mail_to varchar(150) E-mailaddress to send notifications to

Expected response

HTTP/1.1 201 Created
Location: https://api.enormail.eu/api/1.0/lists/1a1a1a1a1a1a1a1a1a1a1a1a1a1.json
HTTP/1.1 201 Created
Location: https://api.enormail.eu/api/1.0/lists/1a1a1a1a1a1a1a1a1a1a1a1a1a1.xml

Update an exisiting list

Updates a list with the info provided.

PUT https://api.enormail.eu/api/1.0/lists/{listid}.{json|xml}

Params

Name Type Description
title varchar(150) Title of the list
send_mail_subscribe tinyint(1) 1 or 0 send mail when a new contact subscribes
send_mail_to varchar(150) E-mailaddress to send notifications to

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "status": "success",
    "code": 1,
    "Message": "List updated"
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <status>success</status>
    <code>1</code>
    <message>List updated</message>
</response>

Delete a list

Deletes a mailinglist from your account.

DELETE https://api.enormail.eu/api/1.0/lists/{listid}.{json|xml}

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "status": "success",
    "code": "1",
    "Message": "List deleted"
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <status>success</status>
    <code>1</code>
    <message>List deleted</message>
</response>

Getting active contacts

Fetches a list of active contacts from your account and the spcified list.

GET https://api.enormail.eu/api/1.0/contacts/{listid}/active.{json|xml}?page={pagenum}

Params

Name Type Description
page integer Page number results

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "results": [
    {
      "contactid": "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a",
      "state": "active",
      "gender": "",
      "name": "John",
      "lastname": "Alpha",
      "email": "example-1@example.com",
      "tags": ["Tag 1", "Tag 2", "Tag 3"],
      "company": "",
      "address": "",
      "postal": "",
      "city": "",
      "country": "",
      "telephone": "",
      "mobile": "",
      "birthday": "",
      "custom1": "",
      "custom2": "",
      "custom3": "",
      "subscribed_at": "20120620003510",
      "confirmed_at": "20120620003732",
      "ip_subscribed": "127.0.0.1",
      "ip_confirmed": "127.0.0.1"
    },
    {
      "contactid": "1b1b1b1b1b1b1b1b1b1b1b1b1b1b11b1b",
      "state": "active",
      "gender": "",
      "name": "Wilson",
      "lastname": "Beta",
      "email": "example-2@example.com",
      "tags": ["Tag 1", "Tag 2", "Tag 3"],
      "company": "",
      "address": "",
      "postal": "",
      "city": "",
      "country": "",
      "telephone": "",
      "mobile": "0611111111",
      "birthday": "",
      "custom1": "",
      "custom2": "",
      "custom3": "",
      "subscribed_at": "20120620003510",
      "confirmed_at": "20120620003732",
      "ip_subscribed": "127.0.0.1",
      "ip_confirmed": "127.0.0.1"
    },
  ],
  "total_results": 2,
  "page_size": 250,
  "number_of_pages": 1,
  "current_page": 1
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <results>
        <contact>
            <contactid>1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a</contactid>
            <state>active</state>
            <gender/>
            <name>John</name>
            <lastname>Alpha</lastname>
            <email>example-1@example.com</email>
            <company/>
            <address/>
            <postal/>
            <city/>
            <country/>
            <telephone/>
            <mobile/>
            <birthday/>
            <custom1/>
            <custom2/>
            <custom3/>
            <subscribed_at>20130212184806</subscribed_at>
            <confirmed_at>20130212184806</confirmed_at>
            <ip_subscribed>127.0.0.1</ip_subscribed>
            <ip_confirmed>127.0.0.1</ip_confirmed>
        </contact>
        <contact>
            <contactid>1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b</contactid>
            <state>active</state>
            <gender/>
            <name>Micheal</name>
            <lastname>Beta</lastname>
            <email>example-2@example.com</email>
            <company/>
            <address/>
            <postal/>
            <city/>
            <country/>
            <telephone/>
            <mobile/>
            <birthday/>
            <custom1/>
            <custom2/>
            <custom3/>
            <subscribed_at>20130212184806</subscribed_at>
            <confirmed_at>20130212184806</confirmed_at>
            <ip_subscribed>127.0.0.1</ip_subscribed>
            <ip_confirmed>127.0.0.1</ip_confirmed>
        </contact>
    </results>
    <total_results>2</total_results>
    <page_size>250</page_size>
    <number_of_pages>1</number_of_pages>
    <current_page>1</current_page>
</response>

Getting unsubscribed contacts

Fetches a list of unsubscribed contacts from your account and the spcified list.

GET https://api.enormail.eu/api/1.0/contacts/{listid}/unsubscribed.{json|xml}?page={pagenum}

Params

Name Type Description
page integer Page number results

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "results": [
    {
      "contactid": "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a",
      "state": "unsubscribed",
      "gender": "",
      "name": "John",
      "lastname": "Alpha",
      "email": "example-1@example.com",
      "company": "",
      "address": "",
      "postal": "",
      "city": "",
      "country": "",
      "telephone": "",
      "mobile": "",
      "birthday": "",
      "custom1": "",
      "custom2": "",
      "custom3": "",
      "subscribed_at": "20120620003510",
      "confirmed_at": "20120620003732",
      "ip_subscribed": "127.0.0.1",
      "ip_confirmed": "127.0.0.1",
      "unsubscribed_at": "20130213135702",
      "unsubscribe_info": "Ontvangt teveel e-mails"
    },
    {
      "contactid": "1b1b1b1b1b1b1b1b1b1b1b1b1b1b11b1b",
      "state": "unsubscribed",
      "gender": "",
      "name": "Wilson",
      "lastname": "Beta",
      "email": "example-2@example.com",
      "company": "",
      "address": "",
      "postal": "",
      "city": "",
      "country": "",
      "telephone": "",
      "mobile": "0611111111",
      "birthday": "",
      "custom1": "",
      "custom2": "",
      "custom3": "",
      "subscribed_at": "20120620003510",
      "confirmed_at": "20120620003732",
      "ip_subscribed": "127.0.0.1",
      "ip_confirmed": "127.0.0.1",
      "unsubscribed_at": "20130213135702",
      "unsubscribe_info": "Geen reden opgegeven"
    },
  ],
  "total_results": 2,
  "page_size": 250,
  "number_of_pages": 1,
  "current_page": 1
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <results>
        <contact>
            <contactid>1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a</contactid>
            <state>unsubscribed</state>
            <gender/>
            <name>John</name>
            <lastname>Alpha</lastname>
            <email>example-1@example.com</email>
            <company/>
            <address/>
            <postal/>
            <city/>
            <country/>
            <telephone/>
            <mobile/>
            <birthday/>
            <custom1/>
            <custom2/>
            <custom3/>
            <subscribed_at>20130212184806</subscribed_at>
            <confirmed_at>20130212184806</confirmed_at>
            <ip_subscribed>127.0.0.1</ip_subscribed>
            <ip_confirmed>127.0.0.1</ip_confirmed>
            <unsubscribed_at>20130213135702</unsubscribed_at>
            <unsubscribe_info>Ontvangt teveel e-mails</unsubscribe_info>
        </contact>
        <contact>
            <contactid>1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b</contactid>
            <state>unsubscribed</state>
            <gender/>
            <name>Micheal</name>
            <lastname>Beta</lastname>
            <email>example-2@example.com</email>
            <company/>
            <address/>
            <postal/>
            <city/>
            <country/>
            <telephone/>
            <mobile/>
            <birthday/>
            <custom1/>
            <custom2/>
            <custom3/>
            <subscribed_at>20130212184806</subscribed_at>
            <confirmed_at>20130212184806</confirmed_at>
            <ip_subscribed>127.0.0.1</ip_subscribed>
            <ip_confirmed>127.0.0.1</ip_confirmed>
            <unsubscribed_at>20130213135702</unsubscribed_at>
            <unsubscribe_info>Geen reden opgegeven</unsubscribe_info>
        </contact>
    </results>
    <total_results>2</total_results>
    <page_size>250</page_size>
    <number_of_pages>1</number_of_pages>
    <current_page>1</current_page>
</response>

Getting unconfirmed contacts

Fetches a list of unconfirmed contacts from your account and the spcified list.

GET https://api.enormail.eu/api/1.0/contacts/{listid}/unconfirmed.{json|xml}?page={pagenum}

Params

Name Type Description
page integer Page number results

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "results": [
    {
      "contactid": "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a",
      "state": "unconfirmed",
      "gender": "",
      "name": "John",
      "lastname": "Alpha",
      "email": "example-1@example.com",
      "company": "",
      "address": "",
      "postal": "",
      "city": "",
      "country": "",
      "telephone": "",
      "mobile": "",
      "birthday": "",
      "custom1": "",
      "custom2": "",
      "custom3": "",
      "subscribed_at": "20120620003510",
      "ip_subscribed": "127.0.0.1"
    },
    {
      "contactid": "1b1b1b1b1b1b1b1b1b1b1b1b1b1b11b1b",
      "state": "unconfirmed",
      "gender": "",
      "name": "Wilson",
      "lastname": "Beta",
      "email": "example-2@example.com",
      "company": "",
      "address": "",
      "postal": "",
      "city": "",
      "country": "",
      "telephone": "",
      "mobile": "0611111111",
      "birthday": "",
      "custom1": "",
      "custom2": "",
      "custom3": "",
      "subscribed_at": "20120620003510",
      "ip_subscribed": "127.0.0.1"
    },
  ],
  "total_results": 2,
  "page_size": 250,
  "number_of_pages": 1,
  "current_page": 1
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <results>
        <contact>
            <contactid>1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a</contactid>
            <state>unconfirmed</state>
            <gender/>
            <name>John</name>
            <lastname>Alpha</lastname>
            <email>example-1@example.com</email>
            <company/>
            <address/>
            <postal/>
            <city/>
            <country/>
            <telephone/>
            <mobile/>
            <birthday/>
            <custom1/>
            <custom2/>
            <custom3/>
            <subscribed_at>20130212184806</subscribed_at>
            <ip_subscribed>127.0.0.1</ip_subscribed>
        </contact>
        <contact>
            <contactid>1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b</contactid>
            <state>unconfirmed</state>
            <gender/>
            <name>Micheal</name>
            <lastname>Beta</lastname>
            <email>example-2@example.com</email>
            <company/>
            <address/>
            <postal/>
            <city/>
            <country/>
            <telephone/>
            <mobile/>
            <birthday/>
            <custom1/>
            <custom2/>
            <custom3/>
            <subscribed_at>20130212184806</subscribed_at>
            <ip_subscribed>127.0.0.1</ip_subscribed>
        </contact>
    </results>
    <total_results>2</total_results>
    <page_size>250</page_size>
    <number_of_pages>1</number_of_pages>
    <current_page>1</current_page>
</response>

Getting bounced contacts

Fetches a list of bounced contacts from your account and the spcified list.

GET https://api.enormail.eu/api/1.0/contacts/{listid}/bounced.{json|xml}?page={pagenum}

Params

Name Type Description
page integer Page number results

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "results": [
    {
      "contactid": "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a",
      "state": "bounced",
      "gender": "",
      "name": "John",
      "lastname": "Alpha",
      "email": "example-1@example.com",
      "company": "",
      "address": "",
      "postal": "",
      "city": "",
      "country": "",
      "telephone": "",
      "mobile": "",
      "birthday": "",
      "custom1": "",
      "custom2": "",
      "custom3": "",
      "subscribed_at": "20120620003510",
      "confirmed_at": "20120620003732",
      "ip_subscribed": "127.0.0.1",
      "ip_confirmed": "127.0.0.1",
      "bounced_at": "20130213135702"
    },
    {
      "contactid": "1b1b1b1b1b1b1b1b1b1b1b1b1b1b11b1b",
      "state": "bounced",
      "gender": "",
      "name": "Wilson",
      "lastname": "Beta",
      "email": "example-2@example.com",
      "company": "",
      "address": "",
      "postal": "",
      "city": "",
      "country": "",
      "telephone": "",
      "mobile": "0611111111",
      "birthday": "",
      "custom1": "",
      "custom2": "",
      "custom3": "",
      "subscribed_at": "20120620003510",
      "confirmed_at": "20120620003732",
      "ip_subscribed": "127.0.0.1",
      "ip_confirmed": "127.0.0.1",
      "bounced_at": "20130213135702"
    },
  ],
  "total_results": 2,
  "page_size": 250,
  "number_of_pages": 1,
  "current_page": 1
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <results>
        <contact>
            <contactid>1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a</contactid>
            <state>bounced</state>
            <gender/>
            <name>John</name>
            <lastname>Alpha</lastname>
            <email>example-1@example.com</email>
            <company/>
            <address/>
            <postal/>
            <city/>
            <country/>
            <telephone/>
            <mobile/>
            <birthday/>
            <custom1/>
            <custom2/>
            <custom3/>
            <subscribed_at>20130212184806</subscribed_at>
            <confirmed_at>20130212184806</confirmed_at>
            <ip_subscribed>127.0.0.1</ip_subscribed>
            <ip_confirmed>127.0.0.1</ip_confirmed>
            <bounced_at>20130213135702</bounced_at>
        </contact>
        <contact>
            <contactid>1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b</contactid>
            <state>bounced</state>
            <gender/>
            <name>Micheal</name>
            <lastname>Beta</lastname>
            <email>example-2@example.com</email>
            <company/>
            <address/>
            <postal/>
            <city/>
            <country/>
            <telephone/>
            <mobile/>
            <birthday/>
            <custom1/>
            <custom2/>
            <custom3/>
            <subscribed_at>20130212184806</subscribed_at>
            <confirmed_at>20130212184806</confirmed_at>
            <ip_subscribed>127.0.0.1</ip_subscribed>
            <ip_confirmed>127.0.0.1</ip_confirmed>
            <bounced_at>20130213135702</bounced_at>
        </contact>
    </results>
    <total_results>2</total_results>
    <page_size>250</page_size>
    <number_of_pages>1</number_of_pages>
    <current_page>1</current_page>
</response>

Getting a contact's details

Retrieves a contact's details.

GET https://api.enormail.eu/api/1.0/contacts/{listid}.{json|xml}?email={email}

Params

Name Type Description
email string The contact's e-mail address (required)

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "listid":"1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a",
    "state":"Active",
    "gender":"M",
    "name":"John",
    "lastname":"Alpha",
    "email":"example@example.com",
    "company":"",
    "address":"",
    "postal":"",
    "city":"",
    "country":"",
    "telephone":"",
    "mobile":"",
    "birthday":"",
    "custom1":"",
    "custom2":"",
    "custom3":"",
    "subscribed_at":"20130228162536",
    "ip_subscribed":"217.123.244.173"
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <listid>1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a</listid>
    <state>Active</state>
    <gender>M</gender>
    <name>John</name>
    <lastname>Alpha</lastname>
    <email>example@example.com</email>
    <company></company>
    <address></address>
    <postal></postal>
    <city></city>
    <country></country>
    <telephone></telephone>
    <mobile></mobile>
    <birthday></birthday>
    <custom1></custom1>
    <custom2></custom2>
    <custom3></custom3>
    <subscribed_at>20130228162536</subscribed_at>
    <ip_subscribed>217.123.244.173</ip_subscribed>
</response>

Adding a contact

Adds a contact to your list. On success it returns the new contact details in the location header.

Important: although you're able to easily add contacts through our API which did not optin to your mailinglist, we highly recommend to use this function with caution. Please use the forms subscribe method to subscribe contacts to your mailinglist and respect the CAN-SPAM-ACT. Abusing this function will risk your account being banned.

POST https://api.enormail.eu/api/1.0/contacts/{listid}.{json|xml}

Params

Name Type Description
listid string The listid the contact is added to (required)
name string The contact's name (required)
email string The contact's e-mailaddress (required)
activate_autoresponder tinyint 1 or 0, trigger the autoresponder on the list for this contact.
Default is 1.
tags Array An array with tag names (optional)
fields array An array with additional fields: (optional)

Name Description
gender M or F
lastname Lastname
company Company name
address Full address
postal Region or postalcode
city City name
country Country name
telephone Telephone number
mobile Mobile telephone number
birthday Birthday date (YYYY-MM-DD)
custom1 Additional field 1
custom2 Additional field 2
custom2 Additional field 3

Expected response

HTTP/1.1 201 Created
Location: https://api.enormail.eu/api/1.0/contacts/1a1a1a1a1a1a1a1a1a1a1a1a1a1.json?email=example-1@example.com
HTTP/1.1 201 Created
Location: https://api.enormail.eu/api/1.0/contacts/1a1a1a1a1a1a1a1a1a1a1a1a1a1.json?email=example-1@example.com

Updating an existing contact

Updates an exisiting contact with the data provided.

PUT https://api.enormail.eu/api/1.0/contacts/{listid}.{json|xml}?email={$email}

Params

Name Type Description
listid string The listid the contact belongs to (required)
name string The contact's name (required)
email string The contact's e-mailaddress (required)
tags Array An array with tag names (optional)
fields array An array with additional fields: (optional)

Name Description
gender M or F
lastname Lastname
company Company name
address Full address
postal Region or postalcode
city City name
country Country name
telephone Telephone number
mobile Mobile telephone number
birthday Birthday date (YYYY-MM-DD)
custom1 Additional field 1
custom2 Additional field 2
custom2 Additional field 3
new_email string The contact's new e-mail address (optional)
move_to_listid string In case of moving the contact to another list, provide the listid the contact is moving to (optional)

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "status": "success",
    "code": "1",
    "Message": "Contact updated"
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <status>success</status>
    <code>1</code>
    <message>Contact updated</message>
</response>

Unsubscribing a contact

Unsubscribes a contact from your mailinglist.

POST https://api.enormail.eu/api/1.0/contacts/{listid}/unsubscribe.{json|xml}

Params

Name Type Description
listid string The listid the contact belongs to (required)
email string The contact e-mail address (required)

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "status": "success",
    "code": 1,
    "Message": "Contact unsubscribed"
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <status>success</status>
    <code>1</code>
    <message>Contact unsubscribed</message>
</response>

Deleting a contact

Delete a contact from your mailinglist.

DELETE https://api.enormail.eu/api/1.0/contacts/{listid}.{json|xml}?email={email}

Params

Name Type Description
listid string The listid the contact belongs to (required)
email string The contact's e-mail address (required)

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "status": "success",
    "code": 1,
    "Message": "Contact deleted"
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <status>success</status>
    <code>1</code>
    <message>Contact deleted</message>
</response>

Getting sent mailings

Finds a list of sent mailings from your account.

GET https://api.enormail.eu/api/1.0/mailings/sent.{json|xml}?page={pagenum}

Params

Name Type Description
page integer Page number resultset

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "results" : [
        {
            "mailingid": "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a",
            "status": "Sent",
            "format" : "html",
            "subject": "Example 1",
            "from_name" : "John Alpha",
            "from_email" : "example1@example.com",
            "created_at": "20130228173128",
            "sent_at" : "20130228173132",
            "total_sent" : 499,
            "total_bounced" : 1,
            "toal_spam_complaints" : 0
        },
        {
            "mailingid": "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a",
            "status": "Sent",
            "format" : "html",
            "subject": "Example 2",
            "from_name" : "Sam Beta",
            "from_email" : "example2@example.com",
            "created_at": "20130214093919",
            "sent_at" : "20130214093922",
            "total_sent" : 465,
            "total_bounced" : 2,
            "toal_spam_complaints" : 0
        },
    },
    "total_results": 2,
    "page_size": 50,
    "number_of_pages": 1,
    "current_page": 1
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <results>
        <mailing>
            <mailingid>1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a</mailingid>
            <status>Sent</status>
            <format>html</format>
            <subject>Example 1</subject>
            <from_name>John Alpha</from_name>
            <from_email>example1@example.com</from_email>
            <created_at>20130228173128</created_at>
            <sent_at>20130228173132</sent_at>
            <total_sent>499</total_sent>
            <total_bounced>1</total_bounced>
            <total_spam_complaints>0</total_spam_complaints>
        </mailing>
        <mailing>
            <mailingid>1b1b1b1b1b1b1b1b1b1b1b11b1b1b1b1b</mailingid>
            <status>Sent</status>
            <format>html</format>
            <subject>Example 2</subject>
            <from_name>Sam Beta</from_name>
            <from_email>example2@example.com</from_email>
            <created_at>20130214093919</created_at>
            <sent_at>20130214093922</sent_at>
            <total_sent>465</total_sent>
            <total_bounced>2</total_bounced>
            <total_spam_complaints>0</total_spam_complaints>
        </mailing>
    </results>
    <total_results>2</total_results>
    <page_size>50</page_size>
    <number_of_pages>1</number_of_pages>
    <current_page>1</current_page>
</response>

Getting draft mailings

Finds a list of draft mailings from your account.

GET https://api.enormail.eu/api/1.0/mailings/drafts.{json|xml}?page={pagenum}

Params

Name Type Description
page integer Page number resultset

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "results" : [
        {
            "mailingid": "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a",
            "status": "Draft",
            "format" : "html",
            "subject": "Example mailing 1",
            "from_name" : "John Alpha",
            "from_email" : "example1@example.com",
            "created_at":"20130228173128"
        },
        {
            "mailingid": "1b1b1b1b1b1b1b1b1b1b1b11b1b1b1b1b",
            "status": "Draft",
            "format" : "html",
            "subject": "Example mailing 2",
            "from_name" : "Sam Beta",
            "from_email" : "example2@example.com",
            "created_at":"20130214093919"
        }
    ],
    "total_results": 2,
    "page_size": 50,
    "number_of_pages": 1,
    "current_page": 1
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <results>
        <mailing>
            <mailingid>1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a</mailingid>
            <status>Draft</status>
            <format>html</format>
            <subject>Example 1</subject>
            <from_name>John Alpha</from_name>
            <from_email>example1@example.com</from_email>
            <created_at>20130228173128</created_at>
        </mailing>
        <mailing>
            <mailingid>1b1b1b1b1b1b1b1b1b1b1b11b1b1b1b1b</mailingid>
            <status>Draft</status>
            <format>html</format>
            <subject>Example 2</subject>
            <from_name>Sam Beta</from_name>
            <from_email>example2@example.com</from_email>
            <created_at>20130214093919</created_at>
        </mailing>
    </results>
    <total_results>2</total_results>
    <page_size>50</page_size>
    <number_of_pages>1</number_of_pages>
    <current_page>1</current_page>
</response>

Getting scheduled mailings

Finds a list of scheduled mailings from your account.

GET https://api.enormail.eu/api/1.0/mailings/scheduled.{json|xml}?page={pagenum}

Params

Name Type Description
page integer Page number resultset

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "results" : [
        {
            "mailingid": "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a",
            "status": "Scheduled",
            "format" : "html",
            "subject": "Example mailing 1",
            "from_name" : "John Alpha",
            "from_email" : "example1@example.com",
            "created_at":"20130228173128",
            "scheduled_at":"20130228173132"
        },
        {
            "mailingid": "1b1b1b1b1b1b1b1b1b1b1b11b1b1b1b1b",
            "status": "Scheduled",
            "format" : "html",
            "subject": "Example mailing 2",
            "from_name" : "Sam Beta",
            "from_email" : "example2@example.com",
            "created_at":"20130214093919",
            "scheduled_at":"20130214093922"
        }
    ],
    "total_results": 2,
    "page_size": 50,
    "number_of_pages": 1,
    "current_page": 1
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <results>
        <mailing>
            <mailingid>1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a</mailingid>
            <status>Scheduled</status>
            <format>html</format>
            <subject>Example 1</subject>
            <from_name>John Alpha</from_name>
            <from_email>example1@example.com</from_email>
            <created_at>20130228173128</created_at>
            <scheduled_at>20130228173132</scheduled_at>
        </mailing>
        <mailing>
            <mailingid>1b1b1b1b1b1b1b1b1b1b1b11b1b1b1b1b</mailingid>
            <status>Scheduled</status>
            <format>html</format>
            <subject>Example 2</subject>
            <from_name>Sam Beta</from_name>
            <from_email>example2@example.com</from_email>
            <created_at>20130214093919</created_at>
            <scheduled_at>20130214093922</scheduled_at>
        </mailing>
    </results>
    <total_results>2</total_results>
    <page_size>50</page_size>
    <number_of_pages>1</number_of_pages>
    <current_page>1</current_page>
</response>

Getting statistics from a sent mailing

Retrieves the click, send, bounced, unsubscribed and opened statistics.

GET https://api.enormail.eu/api/1.0/mailings/{mailingid}/stats.{json|xml}

Params

Name Type Description
mailingid string The uniqueid of the mailing

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "mailingid": "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a",
  "format": "html",
  "subject": "Example mailing",
  "from_name": "Johan Alpha",
  "from_email": "example1@example.com",
  "created_at": "20130213133504",
  "sent_at": "20130213133510",
  "statistics": {
    "totalsent": 20566,
    "totalbounced": 239,
    "totalopened": 4922,
    "totaluniqueopened": 3073,
    "totalclicked": 367,
    "totaluniqueclicked": 298,
    "totalreceived": 20327,
    "totalunopened": 17254,
    "totalsubscribed": 20277,
    "totalunsubscribed": 50,
    "openratio": 14.9,
    "clickratio": 1.5,
    "bounceratio": 1.2,
    "unopenratio": 83.9,
    "unsubscribedratio": 0.2,
    "subscribedratio": 99.8
  }
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <mailingid>1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a</mailingid>
    <format>html</format>
    <subject>Example mailing</subject>
    <from_name>John Alpha</from_name>
    <from_email>example1@example.com</from_email>
    <created_at>20130213133504</created_at>
    <sent_at>20130213133510</sent_at>
    <statistics>
        <totalsent>20566</totalsent>
        <totalbounced>239</totalbounced>
        <totalopened>4922</totalopened>
        <totaluniqueopened>3073</totaluniqueopened>
        <totalclicked>367</totalclicked>
        <totaluniqueclicked>298</totaluniqueclicked>
        <totalreceived>20327</totalreceived>
        <totalunopened>17254</totalunopened>
        <totalsubscribed>20277</totalsubscribed>
        <totalunsubscribed>50</totalunsubscribed>
        <openratio>14.9</openratio>
        <clickratio>1.5</clickratio>
        <bounceratio>1.2</bounceratio>
        <unopenratio>83.9</unopenratio>
        <unsubscribedratio>0.2</unsubscribedratio>
        <subscribedratio>99.8</subscribedratio>
    </statistics>
</response>

Creating a new draft mailing

Creates a new draft mailing in your account.

POST https://api.enormail.eu/api/1.0/mailings.{json|xml}

Params

Name Type Description
format string The format of the mailing (html | plaintext)
default html (required)
subject string The subject of the mailing (required)
body string The message body of the mailing (required)
fromname string The sender name (required)
fromemail string The sender e-mail address (required)
replyto string The e-mail address where reply's
should be sent to (default fromemail)
track_mail_open tinyint Whether to track mail openes
(html only, 0 or 1) (default 1)
track_link_click tinyint Whether to track link clicks
(html only, 0 or 1) (default 1)
track_google_analytics tinyint Whether to add GA tracking
(html only, 0 or 1) (default 0)
google_analytics_campaign string The name of the GA campaign
(html only) (default enormail)

Expected response

HTTP/1.1 201 Created
Location: https://api.enormail.eu/api/1.0/mailings/1a1a1a1a1a1a1a1a1a1a1a1a1a1.json
HTTP/1.1 201 Created
Location: https://api.enormail.eu/api/1.0/mailings/1a1a1a1a1a1a1a1a1a1a1a1a1a1.xml

Sending a draft mailing

Sends a draft mailing from your account.

POST https://api.enormail.eu/api/1.0/mailings/{mailingid}/send.{json|xml}

Params

Name Type Description
mailingid string The id of the draft mailing to send (required)
lists array An array of list id's where the mailing should be sent to (required)
schedule_at string The timestamp when the mailing shoud be sent,
use "now" for immediate sending or a timestamp
to schedule (format: YYYYMMDDHHIISS) (required)

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "status": "success",
    "code": 1,
    "Message": "Mailing has successfully been scheduled for delivery"
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <status>success</status>
    <code>1</code>
    <message>Mailing has successfully been scheduled for delivery</message>
</response>

Unschedule a scheduled mailing

Unschedules a scheduled mailing and saves it in your draft mailings.

POST https://api.enormail.eu/api/1.0/mailings/{mailingid}/unschedule.{json|xml}

Params

Name Type Description
mailingid string The id of the draft mailing to unschedule (required)

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "status": "success",
    "code": "1",
    "Message": "Mailing is successfully unscheduled"
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <status>success</status>
    <code>1</code>
    <message>Mailing is successfully unscheduled</message>
</response>

Deleting a draft mailing

Deletes a mailing from your draft mailings.

DELETE https://api.enormail.eu/api/1.0/mailings/{mailingid}/delete.{json|xml}

Params

Name Type Description
mailingid string The id of the draft mailing to delete (required)

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "status": "success",
    "code": "1",
    "Message": "Mailing deleted"
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <status>success</status>
    <code>1</code>
    <message>Mailing deleted</message>
</response>

Getting your API formid

When communicating with forms you require an unique formid. In the following sequence you'll find instructions to retrieve your formid.

First, create a new form or go to your form publish settings.

Publish form

Second, copy the formid from the publish settings.

Getting formid

Subscribing contacts with forms

Subscribes a contact through your subscribtion form. This method wil act like the form has been submitted by the contact. On success the subscribe method will send your activation message to the subscribing contact.

POST https://api.enormail.eu/api/1.0/forms/{formid}.{json|xml}

Params

Name Type Description
name string The contact name (required)
email string The contact e-mail address (required)
fields array An array with additional fields, some fields
maybe required depending on
form settings.

Name Description
gender M or F
lastname Lastname
company Company name
address Full address
postal Region or postalcode
city City name
country Country name
telephone Telephone number
mobile Mobile telephone number
birthday Birthday date (YYYY-MM-DD)
custom1 Additional field 1
custom2 Additional field 2
custom2 Additional field 3

Expected response

HTTP/1.1 201 Created
Location: https://api.enormail.eu/api/1.0/contacts/1a1a1a1a1a1a1a1a1a1a1a1a1a1.json?email=example-1@example.com
HTTP/1.1 201 Created
Location: https://api.enormail.eu/api/1.0/contacts/1a1a1a1a1a1a1a1a1a1a1a1a1a1.json?email=example-1@example.com

Getting a list of forms

Retrieves a list of forms from your account.

GET https://api.enormail.eu/api/1.0/forms.{json|xml}

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "formid": "a1a1a1a1a1a1a1a1a1a1a1a",
    "title": "Example form 1",
    "list": {
      "listid": "a1a1a1a1a1a1a1a1a1a1a1a",
      "title": "List example"
    },
    "publish": {
      "url": "https://app.enormail.eu/subscribe/a1a1a1a1a1a1a1a1a1a1a1a",
      "js": "https://app.enormail.eu/external/form/a1a1a1a1a1a1a1a1a1a1a1a.js"
    },
    "fields": {
      "gender": {
        "use": 0,
        "required": 0,
        "label": "gender",
        "weight": 0
      },
      "birthday": {
        "use": 0,
        "required": 0,
        "label": "birthday",
        "weight": 0
      },
      "lastname": {
        "use": 0,
        "required": 0,
        "label": "lastname",
        "weight": 0
      },
      "company": {
        "use": 1,
        "required": 1
        "label": "company",
        "weight": 0
      },
      "address": {
        "use": 1,
        "required": 0,
        "label": "address",
        "weight": 0
      },
      "postal": {
        "use": 1,
        "required": 0,
        "label": "postal",
        "weight": 0
      },
      "city": {
        "use": 1,
        "required": 0,
        "label": "city",
        "weight": 0
      },
      "country": {
        "use": 0,
        "required": 0,
        "label": "country",
        "weight": 0
      },
      "telephone": {
        "use": 0,
        "required": 0,
        "label": "telephone",
        "weight": 0
      },
      "mobile": {
        "use": 0,
        "required": 0,
        "label": "mobile",
        "weight": 0
      },
      "custom1": {
        "use": 0,
        "required": 0,
        "label": "custom1",
        "weight": 0
      },
      "custom2": {
        "use": 0,
        "required": 0,
        "label": "custom2",
        "weight": 0
      },
      "custom3": {
        "use": 0,
        "required": 0,
        "label": "custom3",
        "weight": 0
      }
    }
  },
  {
    "formid": "b1b1b1b1b1b1b1b1b1b1b1b1",
    "title": "Example form 2",
    "list": {
      "listid": "c1c1c1b1c1c1c1c1c1c1c1c1",
      "title": "List example 2"
    },
    "publish": {
      "url": "https://app.enormail.eu/subscribe/b1b1b1b1b1b1b1b1b1b1b1b1",
      "js": "https://app.enormail.eu/external/form/b1b1b1b1b1b1b1b1b1b1b1b1.js"
    },
    "fields": {
      "gender": {
        "use": 0,
        "required": 0,
        "label": "gender",
        "weight": 0
      },
      "birthday": {
        "use": 0,
        "required": 0,
        "label": "birthday",
        "weight": 0
      },
      "lastname": {
        "use": 0,
        "required": 0,
        "label": "lastname",
        "weight": 0
      },
      "company": {
        "use": 1,
        "required": 1,
        "label": "company",
        "weight": 0
      },
      "address": {
        "use": 1,
        "required": 0,
        "label": "address",
        "weight": 0
      },
      "postal": {
        "use": 1,
        "required": 0,
        "label": "postal",
        "weight": 0
      },
      "city": {
        "use": 1,
        "required": 0,
        "label": "city",
        "weight": 0
      },
      "country": {
        "use": 0,
        "required": 0,
        "label": "country",
        "weight": 0
      },
      "telephone": {
        "use": 0,
        "required": 0,
        "label": "telephone",
        "weight": 0
      },
      "mobile": {
        "use": 0,
        "required": 0,
        "label": "mobile",
        "weight": 0
      },
      "custom1": {
        "use": 0,
        "required": 0,
        "label": "custom1",
        "weight": 0
      },
      "custom2": {
        "use": 0,
        "required": 0,
        "label": "custom2",
        "weight": 0
      },
      "custom3": {
        "use": 0,
        "required": 0,
        "label": "custom3",
        "weight": 0
      }
    }
  }
]
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <form>
        <formid>a1a1a1a1a1a1a1a1a1a</formid>
        <title>Example form 1</title>
        <list>
            <listid>a1a1a1a1a1a1a1a1a1a</listid>
            <title>List example</title>
        </list>
        <publish>
            <url>https://app.enormail.eu/external/subscribe/a1a1a1a1a1a1a1a1a1a</url>
            <js>https://app.enormail.eu/external/form/a1a1a1a1a1a1a1a1a1a.js</js>
        </publish>
        <fields>
            <gender>
                <use/>
                <required/>
                <label/>
                <weight/>
            </gender>
            <birthday>
                <use/>
                <required/>
                <label/>
                <weight/>
            </birthday>
            <lastname>
                <use/>
                <required/>
                <label/>
                <weight/>
            </lastname>
            <company>
                <use/>
                <required/>
                <label/>
                <weight/>
            </company>
            <address>
                <use/>
                <required/>
                <label/>
                <weight/>
            </address>
            <postal>
                <use/>
                <required/>
                <label/>
                <weight/>
            </postal>
            <city>
                <use/>
                <required/>
                <label/>
                <weight/>
            </city>
            <country>
                <use/>
                <required/>
                <label/>
                <weight/>
            </country>
            <telephone>
                <use/>
                <required/>
                <label/>
                <weight/>
            </telephone>
            <mobile>
                <use/>
                <required/>
                <label/>
                <weight/>
            </mobile>
            <custom1>
                <use/>
                <required/>
                <label/>
                <weight/>
            </custom1>
            <custom2>
                <use/>
                <required/>
                <label/>
                <weight/>
            </custom2>
            <custom3>
                <use/>
                <required/>
                <label/>
                <weight/>
            </custom3>
        </fields>
    </form>
</response>

Embedding forms

Renders the form and returns the html of the requested form.

GET https://api.enormail.eu/api/1.0/forms/{formid}/html.{json|xml}

Expected response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "css": "Not yet available",
  "html": "&lt;form id=&quot;subscribe&quot; method=&quot;post&quot; action=&quot;https://app.enormail.eu/external/subscribe/1a1a1a1a1a1a1a1a1a11a1a1a1a1a1a1a&quot;&gt;\r&lt;div&gt;\r&lt;label for=&quot;name&quot;&gt;Naam:&lt;/label&gt;&lt;br/&gt;\r&lt;input type=&quot;text&quot; id=&quot;name&quot; class=&quot;textfield&quot; name=&quot;name&quot; value=&quot;&quot; /&gt;&lt;br/&gt;\r&lt;label for=&quot;email&quot;&gt;E-mail adres:&lt;/label&gt;&lt;br/&gt;\r&lt;input type=&quot;text&quot; id=&quot;email&quot; class=&quot;textfield&quot; name=&quot;email&quot; value=&quot;&quot; /&gt;&lt;br/&gt;\r&lt;input type=&quot;submit&quot; value=&quot;Aanmelden&quot; class=&quot;submit-btn&quot; /&gt;\r&lt;/div&gt;\r&lt;/form&gt;\r"
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<response>
    <css>Not yet available</css>
    <html>
        <form id="subscribe" method="post" action="https://app.enormail.eu/external/subscribe/4b4a6c40540a017afe7e42061435e2a1">
            <div>
                <label for="name">Naam:</label><br/>
                <input type="text" id="name" class="textfield" name="name" value="" /><br/>
                <label for="email">E-mail adres:</label><br/>
                <input type="text" id="email" class="textfield" name="email" value="" /><br/>
                <input type="submit" value="Aanmelden" class="submit-btn" />
            </div>
        </form>
    </html>
</response>