The Email API Guide You’ve Been Looking For

The email API guide for advanced marketers

Email API makes your life easy. It boldly goes where no human marketer can, and it’s not located in a galaxy far away (and pardon our blasphemy, combining these two). All you have to do is set it up and enjoy the benefits. Here’s how.

In email marketing, almost everything you do can be processed, analyzed or accessed faster via an email API. This automated agent works on your behalf, doing things you can’t do.

This bot-like script is a `harder, faster, better, stronger’ version/extension of your will and capabilities. It allows you to reach corners of the internet that humans wouldn’t understand, retrieving data from storage warehouses without compromising security, and so much more.

Every high-volume email marketer needs an email API to handle the heavy lifting. They can extract and deliver your data where it needs to go while ensuring that the processes running in the background do so smoothly. Something we humans simply can’t do.

Like the sci-fi androids we all know and love, the email API acts as a bridge between human marketers and digital interfaces. They can:

  • Make messaging a lot easier for both senders and recipients. 
  • They quickly and easily perform tasks that can’t scale well otherwise. 

And so much more.

In this post, we’ll take you through the ins and outs of email API and help you to use our very own Ongage API to connect to every email SMTP relay out there, communicate effectively with your back-end/CRM, and perform actions outside the UI.

If you’re looking to jump right into the advanced Email API stuff, press here.

Otherwise, the below stuff is important as you need to understand how Email API can help you improve your email operation’s performance.

Want to jump ahead?

#1 A short intro to API and how it’s being used today
#2 What’s an email API?
   Should you build your solution and connect to an email API?
   What should you do instead?
#3 The advantages of connecting an SMTP relay to Ongage
   Improving your analytics game
   Segmentation
   High-volume sending
   Ease of use
   Cost efficiency
#4 How do people use the Ongage email API?
#5 The Ongage UI is built on an API
#6 How to make calls to the Ongage API
   Importing contacts
   Transactional messages
   Events & Triggers
#7 Additional email API services
What’s your dream email API?

#1 A short intro to API and how it’s being used today

An API is an interface that allows apps to communicate with one another. For example, while APIs are not themselves databases, they enable marketers to gain data from databases without compromising security.

How can they do that? Via the API, you define what you take, and you have access only to that data point. It has neither the access nor the need to take the data it hasn’t got permission for. 

That’s why, much like in other fetch tasks, let’s say takeaway delivery services, bots are better than humans.

  • Suppose you hire a human to pick up your takeaway. Can you be sure that they won’t sneak a fry or two on their way back? 
  • If you hire a robot to do it, the robot not only has no need or desire to nibble on your food, it physically can’t. 

Much like our delivery bot, APIs are the same with databases and the data point they communicate with. They retrieve and deliver what they’re allowed to and go no further than that.

All over the world, businesses and brands use APIs to streamline experiences. Here are a few examples:

  • Weather snippets

If you search Google for the weather in your location, it will give you the answer in a snippet, like this:

Google does not forecast the weather. Instead, they use an API to get weather data from a third party. The API then relays this data back to Google, who presents this to searchers in a more digestible way.

  • Social log-in/OAuth

Logging in to new websites via your Google, Facebook, or other social account makes life very easy for those of us who are terrible at remembering passwords. To link up these accounts, the site sends an API call out on a mission to collect information from Google, etc. 

An API can gather and authenticate your data without actually logging into your account (remember that fry delivery bot?), making it a safe and secure way to transfer login details from site to site.

  • Paypal payments

Paypal takes away the hassle of having to enter card details again and again. Simply click the ‘Pay with Paypal’ button on eCommerce sites, and your money lands on the vendor’s doorstep in a couple of clicks.

Paypal uses an API to make this process quick, simple, and secure. When you click that ‘Pay with Paypal’ button, the vendor site sends an order to the Paypal API. The API quickly takes care of the deal while keeping all your sensitive information safe and secure. In no time at all, the API confirms the order, and the transaction is complete.

Now that we know what an API does, let’s dive into what it can do for you in email marketing, including how it can improve your deliverability, delivery, engagement, and much more.

#2 What’s an email API?

When you opt for an SMTP relay like Amazon SES, Ongage SMTP, Sparkpost, or Mailgun, you gain the basic (but important) function of sending emails out to recipients.

An email API takes things a step further, unlocking a few extra email marketing abilities. 

For example, by connecting to an SMTP relay’s API, you can send transactional emails and enjoy basic reporting and analytics.

However, this is just the beginning. Using an API will help you to build a thoroughly robust email marketing operation.

To send high-end campaigns, email marketers need a host of other sophisticated features, such as behavioral segmentation, automation modules, and an easy UI. Without these, it will be hard to manage everything that a sophisticated email campaign requires.

Should you build your solution and connect to an email API?

It is possible to build such a system from scratch, but you should consider whether or not it’s worth it. The development costs accumulate, and it’s a slow process. 

We asked our very own Ongage VP of R&D, Nitzan Aviram, how much effort it would take. Here’s his answer:

Any operation you’ll create from scratch will take a lot of time and effort. That’s why pizza deliveries are a thing. Nobody in his right mind will want to create a pizza from scratch!

You don’t want to invest in growing the wheat, mushrooms, tomatoes, and making the cheese, no way. And don’t get me started on processing all the ingredients, building a pizza place, and getting the recipe right!

No. You want a tasty pizza that you can order quickly, and you want it delivered to your doorstep as fast as possible.

That’s exactly what your Email API does. It fetches what you want and does so instantaneously. It connects your SMTP relay to a broader platform that provides you with analytical sauce, segmentation pizza cutter, personalized toppings, and an oven to automate it all.

What should you do instead?

The Ongage email API does everything mentioned above and more. It supports plug-and-play connectivity to over 20 top-tier SMTP relays, including all the ones below:

Amazon SES

This popular SMTP is reliable and scalable. It earned a place in the tech stacks of giants like Netflix, Slack, and (of course) Amazon itself. It’s reasonably priced and has great customer support.

Mailgun

Mailgun is known for improving deliverability and keeping senders off blacklists, allowing you to send all your emails via the Ongage dashboard. Its pricing is flexible, depending on your sending volume. 

Sparkpost

Sparkpost markets itself as a ‘predictive email intelligence platform.’ It’s known for its analytical services, and users testify that it’s great for deliverability.

Sendgrid

Sendgrid claims to have ‘pioneered transactional email,’ and their customers have nothing but praise for their customer service.

Pepipost

Pepipost’s deliverability reputation is second to none, and their analytics suite is impressively robust. 

Socketlabs

Socketlabs is a good all-rounder. The Socketlabs team pride themselves on technical expertise and great customer support.

InboxRoad 

If you’re targeting the European market, InboxRoad has you covered. They’re reliable and affordable.

SMTP.com

This vendor is great for high volume campaigns, and they have some ambitious plans for increasing automation. Their pricing is reasonable but varies depending on send volume. 

mySMTP.com

This is another SMTP that’s great for sending to Europe. And is pretty flexible in terms of operation. 

PowerMTA

PowerMTA allows you to explore a complete SMTP log file, making it easy to find the source of deliverability issues. It’s also got a great analytics suite. 

Ongage SMTP

Ongage has a built-in SMTP relay that allows you to set up an account and run large scale campaigns in a matter of hours. Having a native SMTP working with an advanced platform has many perks. If you’d like to give it a go, register, and we’ll get you up and running in no time.

Whichever solution you choose, you’ll gain many features to help your emails get into the inbox. What’s more, you’ll get them at a fraction of the cost and time of developing the system yourself.

#3 The advantages of connecting an SMTP relay to Ongage

By combining the deliverability power of an SMTP relay and the feature-rich dashboard of Ongage, many tasks are made much more straightforward, including:

Improving your analytics game

A good analytics suite makes a huge difference in terms of your optimization capabilities. Ongage’s analytics suite brings in all kinds of useful intelligence about your campaigns, what’s going right, what’s going wrong, obstacles to overcome, and the best ways to improve your performance.

Analytics and the insights they bring can make or break an email campaign. Analytical capability is not something that you can give up on, and Ongage offers this built-in advantage at every package level.

Segmentation

Email Segmentation is vital for both deliverability and engagement. Ongage makes it easy to categorize recipients based on various data points – for example, behavior, psychographics, demographics, and so on. By categorizing in this manner, you can send out content that’s closely targeted to specific segments’ needs and characteristics.

Putting less engaged users in their own segment and reducing sends to them will also help to protect your sender reputation from low engagement metrics.

The Ongage toolset can organize and create contacts, segments, list fields, and other details with ease. It can also be automated, making it much easier to send highly targeted, personalized emails.

High-volume sending

A good SMTP relay offers heightened deliverability and enables marketers to send in high volumes without being marked as spam. Through Ongage’s API, you can easily send emails via most SMTPs, while curating high-volume campaigns through the easy-to-use dashboard.

Ease of use

The whole point of automating and streamlining process like you do when you use an API is that it makes life much easier for us humans. Like our smart bot, who can bring you pizza on demand, Ongage works to bring email marketers what they want, on-demand. 

Our UI will guide and help you through every step of an email campaign. You won’t be stepping out alone into the outer space of email without a lifeline. The interface is easy and intuitive to use, and it makes even the most complex marketing tasks simple.

Cost efficiency

A serious email marketing operation needs a host of advanced features. These are vital for all the reasons mentioned above.

If you’re a high-volume sender, you must use features that help with intensive targeting, automation, transactional emails, and so on. The enhanced efficiency you’ll get from developing an integration to your SMTP API might make up for the initial costs (time and money) and might become cost-effective in the long run, but not without constant maintenance.

But as mentioned above, building all these capabilities yourself takes a lot of time and money.

Before making something from scratch, you should consider if the costs are worth it, and if it’s not efficient to opt-in to a platform like Ongage that will have you up and running in a day, with advanced capabilities that will take a small army of developers a year to develop.  

#4 How do people use the Ongage email API?

Joshua Blumenfeld, CEO of the leading job search website MyJobHelper, had this to say about the Ongage API:

“The Ongage API has been wonderful”, he told us in a recent interview, “it allows us to do stuff in bulk, which is obviously how you want to do everything, especially when you send 600 million emails per month. 

We send an enormous number of unique and segmented messages, and you can’t manually go into the interface and do it yourself. 

Every single feature is available through the API. As time goes on, we become more and more complicated in our targeting, having the ability to use the API, and being able to transfer things from a spreadsheet to Ongage has been great.”

Leading job site Myjobhelper

On top of this, the flexibility of the Ongage API allows you to improve your personalization and segmentation efforts further. TN Marketing, a leading e-learning service, uses the API to send users on personalized journeys.

Their system is updated with data about the customer’s purchases, which is then synced with Ongage. This way, TN marketing can send highly-tailored emails to users based on purchasing habits.

Neil Rice, VP of Technology at TN Marketing, says: 

“A data warehouse is a key growth weapon. With the Ongage API, we integrated our audience list within Ongage. Now, with the data, we can maintain a great reputation with our IP domains. The technology of the API means that we really do control our communications engine. It’s not a black box.” 

#5 The Ongage UI is built on an API

The Ongage UI is a modern full-featured JSON REST API. 

It is written completely on top of the Ongage API. This means that anything you can do in the UI you can do with the API, and more!

You don’t need an SDK to use the Ongage API. All you need is: 

  1. An Ongage account and account code.
  2. Login credentials.
  3. The API instructions we’ll go through in a moment.

When you connect your data warehouse or CRM to Ongage, you can shift data from one to the other.

Getting data from every channel enables you to:

Improve automation

Automation helps you to connect with customers in real-time. Emails that respond to automated triggers (for example, a welcome email sent within seconds of a new subscription) give a sense of immediacy and are hugely relevant for the recipient.

However, for your automation to be timely, relevant, and personalized, they need data. 

The more data points your email marketing platform can integrate, the more detailed you can make your automation’ triggers and goals. Using the Ongage API to connect your CRM and email marketing platform opens up a wealth of data with which to feed your automation, allowing you to use up to 150 data points simultaneously.

Get insights

Your CRM is full of insights about your customers. Not just open and click metrics, but purchase behavior, links they’ve followed, interactions with customer service, and so on. 

This is important because sometimes, email marketing doesn’t tell the full story. Other departments also interact with your customers. Sales and customer service teams (for example) have a lot of information that can help you get a bigger picture and improve your customer segments.

Refining your segments via additional data points allows you to craft more personalized campaigns, which leads to increased campaign performance.

Use real-time data

A CRM integration can give you insights in real-time. For example, it can tell your email platform what device a person uses to interact with your emails, their geographical location, and more.

This is important when it comes to automated emails. Cart abandonment emails, for example. A CRM integration enables you to set up cart abandonment as an automated trigger. When a person abandons their cart, an email will be sent in real-time, prompting them to complete their purchase with relevant and up-to-date data. This is true for other transactional messages such as delivery confirmation, password reset, and more.With the Ongage API, you can easily integrate your CRM to Ongage and run all of the operations mentioned above.

#6 How to make calls to the Ongage API

Here are some examples of how you can use your Ongage API. Of course, there are many more, and custom integrations that we won’t dive into. Contact us for more details.

Importing contacts

To send emails via Ongage, you must import contacts to the platform. You can do this in two ways: 

  1. In real-time via the API – 
    • All you have to do is make a POST request from your CRM or webform to:
https://api.ongage.net/api/v2/contacts/
    • In that request, use a JSON payload, like in this example:
{ "email": "john@doe.com", "name": "John Doe", "country": "Chile" }
  1. In bulk, by uploading a CSV file via the UI or API with the following JSON payload:
{
   "list_id":1234,
   "file_url":"http://www.yourdomain.com/filename.csv",
   "csv_delimiter":",",
   "encoding":"UTF-8",
   "overwrite":false,
   "ignore_empty":true,
   "send_welcome_message":false,
   "fields":{
      "email":{
         "name":"email",
         "type":"email",
         "format":"",
         "default":""
      },
      "address":{
         "name":"address",
         "type":"string",
         "format":"",
         "default":""
      },
      "country":{
         "name":"country",
         "type":"string",
         "format":"",
         "default":""
      }
   }
}

Transactional messages

The Ongage API, combined with the automation rules module, allows you to use transactional messages to react in real-time to actions subscribers make like buying items, changing service plans, and more.

To do this, you need to make a POST request with a JSON payload.

For example:

{
   "message_id":4567,
   "campaign_id":213,
   "recipients":[
      "john@email.com",
      "jane@email.com"
   ],
   "sending_connection_id":1234,
   "message_dynamic_fields_per_recipient":[
      {
         "recipient":"john@email.com",
         "key_value_collection":{
            "first_name":"John",
            "age":34
         }
      },
      {
         "recipient":"jane@email.com",
         "key_value_collection":{
            "first_name":"Jane",
            "age":28
         }
      }
   ]
}
// Email with the following HTML
<p>
   Hello {{first_name}} and congratulations on your birthday, you are {{age}} years old!
</p>

This is just one example of many. For additional info, visit our documentation.

Events & Triggers

With the Ongage API, you can set up predefined events and journeys for users without accessing the UI.

To do this, send a POST command with a JSON payload.

This example will create an event that sends an email message on a user’s birthday at 10:30.

{
   "name":"Birth date event",
   "based_on":"date_field",
   "date_field_name":"birth_date",
   "annually_event":true,
   "ongoing_event":true,
   "status":true,
   "segments":[ 60478 ],
   "distribution":[
      {
         "esp_connection_id":60142,
         "domain":"default",
         "percent":100
      }
   ],
   "triggers":[
      {
         "based_on":"list_field",
         "email_messages":[ 2381 ],
         "days_diff":0,
         "operator":"after",
         "schedule_hour":10,
         "schedule_minute":30
      }
   ]
}

For more on how you can utilize events and triggers with our API, visit this page.

#7 Additional email API services

Integrating an API isn’t for everyone. While it’s worthwhile in the long run, the initial cost of setting up the integration might deter some email marketers. Not to mention the timescale – we estimate that it will take 2-3 weeks for the average developer to connect your backend to Ongage (although, setting up the rest of your email operation on Ongage, takes only a few hours).

However, if you’re sending low volumes of email or want to update your email marketing platform with real-time data, third-party integration could prove very useful. Some tools can help without API Integrations.

Web automation platforms like Zapier and Integromat can help you to create connections easily.  

Zapier and Integromat use webhooks to connect different applications. Through these webhooks, they can:

  • Integrate – link your web apps so that they can share data.
  • Automate – Pass information between your apps.
  • Innovate – Build processes faster without the need for coding.

Bear in mind that such platforms charge by the amount of data you transfer – Zapier costs between 19USD and 600USD PCM depending on how you use it. Weigh the costs in advance to ensure that integrating an API with the help of a dev team is not more cost-efficient.

As a general note, using SaaS platforms is the best way to ramp up fast. Depending on your sending volume, this could also be the most cost-effective solution. 

What’s your dream email API?

Sure, an API can be your personal delivery bot – but it can also be so much more. 

As well as delivering data from place to place, our API can translate, clarify, speed up processes, automate your campaigns, integrate your marketing operations, manage your list, and much more.

The thing is that a bot is as limited as the imagination of its creator. We’re always looking to improve, and here you can help!

What would be on your shopping list when getting an email API? Let us know in the comments.

Get our email tips in your inbox

By signing up you are agreeing to our Terms of Service.

Recent Posts

Scroll to Top