API allows services and applications to exchange data fast and precisely, which draws the attention of not only web developers but also specialists without a strong technical background. Marketers appreciate an API’s ability to find the most effective combination of platforms without worrying about compatibility issues.
In this article, we will explain how to use the SendPulse email service API. You will also get our step-by-step guide on creating an email campaign and getting statistics on it.
[contents]
What is an API?
API stands for Application Programming Interface. It is an interface where applications interact in the process of completing a certain common task.
API was designed to enable the exchange of data between applications and services. This is why it doesn’t have a common interface with various icons and buttons — unlike interfaces designed for users of applications. API is represented by a set of ready-made classes, functions, procedures, structures, and constants.
In fact, you use it daily: transferring information from one app to another or setting up tasks on the automated pairing of systems. For instance, API is used when online services allow you to log in with your social media account instead of requiring registration.
How API helps marketers
Marketers need to be flexible while getting the necessary information. As a rule, they gather data from multiple channels, which hardly ever suggest a common interface. When information is transferred from one system to another via API, such interfaces don’t really matter. What matters is that both systems recognize common parameters of requests and replies. This way, data transfers quickly, which is essential for tasks that require speed and precision.
To get an idea of how an API can be useful for a marketer, they should find out what data is available via that API and how to get it. Ask a web developer to check the API you are interested in and discuss possible options for integration.
What you can do with the SendPulse API?
Use SendPulse’s API for operations with mailing lists, senders, email campaigns and templates, as well as blacklists. Check your account balance and get information on the campaigns.
You can find the complete SendPulse API documentation on our website. It contains requirements for developers who create integrations.
How to use SendPulse services via API
We used an API testing tool called Postman to illustrate workflow examples. This application is available for Mac, Windows and Linux, and it doesn’t require knowledge of any programming language. The app operates in launch, testing, documentation, and tracking modes. Feel free to use any similar application for your purposes.
Let’s have a look at an example that shows how to create an email campaign via API and how to get its statistics.
1. Authorize in the service
Get the personal access token applying the method from SendPulse documentation. Use API ID and API Secret values indicated in your SendPulse account settings.
Send an API request with these values to obtain the access token. The service will send you back the token and indicate its type.
You will need this token to sign each API request. Note that the token is only valid for one hour and after expiry, it requires renewal — in this case, you should repeat Step 1. Besides, for security reasons, users can update the API ID and API Secret values in their SendPulse account settings. Once you have done that, generate a new access token.
2. Create an address book
3. Get the address book ID
Use the API method to obtain detailed information on email addresses from the book. We recommend that you save the ID value to be able to identify address books in further operations.
4. Upload email addresses into the address book
When email addresses are added to the address book, the corresponding variables are transferred as well — in this case, it is the {{Name}} variable with the value {{Elvira}}.
5. Upload email template
If you already have a template, upload it into the service using the method provided in SendPulse documentation.
Before creating a campaign, define the ID of the template you have uploaded. Once you get a list of all templates, identify the one you need by the name.
If you don’t have a template yet, build one with the SendPulse drag and drop editor.
6. Create a campaign to be sent to the whole address book
Replace the “body” parameter with “template_id” parameter using the ID value you got on the previous step.
7. Retrieve information on the campaign
It is important for marketers to know the information on the status of the sent campaign, and SendPulse API allows getting it. As illustrated below, one can see the following data: the sender name and address, the email subject and content, the number of emails in the campaign, its status, and the sending date.
through various API methods, we have created an email campaign based on a custom template, and retrieved information on it.
Detailed statistics on email campaigns are available directly in your SendPulse account.
8. Check how the email displays in the recipient’s mailbox
As you see on the illustration below, the subscriber’s name appeared in the header: the variable {{Name}} was transferred into the header when we added recipients to the address book.
9. Option to send an automated series of emails
After adding a template (Step 5), you can send a series of automations. For instance, a date could be selected as a starting condition of the series. Let’s say, we pick the first order anniversary as the date and an email with a special offer as the first element of the automated series.
After this email has been sent on the specified date, there is an option to send a webhook. This way a special variable will be automatically added for the subscriber on the mailing list, depending on their actions with the email — they may open it, unsubscribe, or mark it as spam.
This way, you can set the transfer of data on your subscribers’ actions with the email and forward it to your system. These results can be used in your further work with the customers.
What’s in the outcome
API simplifies complex cooperation between systems. A user doesn’t have to process a large volume of data for each system because API lets the systems cooperate, facilitating the marketer’s job. Show this article to a web developer and just start integrating SendPulse with your project via API.API allows services and applications to exchange data fast and precisely, which draws the attention of not only web developers but also specialists without a strong technical background. Marketers appreciate an API’s ability to find the most effective combination of platforms without worrying about compatibility issues.
In this article, we will explain how to use the SendPulse email service API. You will also get our step-by-step guide on creating an email campaign and getting statistics on it.
- What is an API?
- How API helps marketers
- What you can do with the SendPulse API?
- How to use SendPulse services via API
- 1. Authorize in the service
- 2. Create an address book
- 3. Get the address book ID
- 4. Upload email addresses into the address book
- 5. Upload email template
- 6. Create a campaign to be sent to the whole address book
- 7. Retrieve information on the campaign
- 8. Check how the email displays in the recipient’s mailbox
- 9. Option to send an automated series of emails
- What’s in the outcome
What is an API?
API stands for Application Programming Interface. It is an interface where applications interact in the process of completing a certain common task.
API was designed to enable the exchange of data between applications and services. This is why it doesn’t have a common interface with various icons and buttons — unlike interfaces designed for users of applications. API is represented by a set of ready-made classes, functions, procedures, structures, and constants.
In fact, you use it daily: transferring information from one app to another or setting up tasks on the automated pairing of systems. For instance, API is used when online services allow you to log in with your social media account instead of requiring registration.
How API helps marketers
Marketers need to be flexible while getting the necessary information. As a rule, they gather data from multiple channels, which hardly ever suggest a common interface. When information is transferred from one system to another via API, such interfaces don’t really matter. What matters is that both systems recognize common parameters of requests and replies. This way, data transfers quickly, which is essential for tasks that require speed and precision.
To get an idea of how an API can be useful for a marketer, they should find out what data is available via that API and how to get it. Ask a web developer to check the API you are interested in and discuss possible options for integration.
What you can do with the SendPulse API?
Use SendPulse’s API for operations with mailing lists, senders, email campaigns and templates, as well as blacklists. Check your account balance and get information on the campaigns.
You can find the complete SendPulse API documentation on our website. It contains requirements for developers who create integrations.
How to use SendPulse services via API
We used an API testing tool called Postman to illustrate workflow examples. This application is available for Mac, Windows and Linux, and it doesn’t require knowledge of any programming language. The app operates in launch, testing, documentation, and tracking modes. Feel free to use any similar application for your purposes.
Let’s have a look at an example that shows how to create an email campaign via API and how to get its statistics.
1. Authorize in the service
Get the personal access token applying the method from SendPulse documentation. Use API ID and API Secret values indicated in your SendPulse account settings.
Send an API request with these values to obtain the access token. The service will send you back the token and indicate its type.
You will need this token to sign each API request. Note that the token is only valid for one hour and after expiry, it requires renewal — in this case, you should repeat Step 1. Besides, for security reasons, users can update the API ID and API Secret values in their SendPulse account settings. Once you have done that, generate a new access token.
2. Create an address book
3. Get the address book ID
Use the API method to obtain detailed information on email addresses from the book. We recommend that you save the ID value to be able to identify address books in further operations.
4. Upload email addresses into the address book
When email addresses are added to the address book, the corresponding variables are transferred as well — in this case, it is the {{Name}} variable with the value {{Elvira}}.
5. Upload email template
If you already have a template, upload it into the service using the method provided in SendPulse documentation.
Before creating a campaign, define the ID of the template you have uploaded. Once you get a list of all templates, identify the one you need by the name.
If you don’t have a template yet, build one with the SendPulse drag and drop editor.
6. Create a campaign to be sent to the whole address book
Replace the “body” parameter with “template_id” parameter using the ID value you got on the previous step.
7. Retrieve information on the campaign
It is important for marketers to know the information on the status of the sent campaign, and SendPulse API allows getting it. As illustrated below, one can see the following data: the sender name and address, the email subject and content, the number of emails in the campaign, its status, and the sending date.
through various API methods, we have created an email campaign based on a custom template, and retrieved information on it.
Detailed statistics on email campaigns are available directly in your SendPulse account.
8. Check how the email displays in the recipient’s mailbox
As you see on the illustration below, the subscriber’s name appeared in the header: the variable {{Name}} was transferred into the header when we added recipients to the address book.
9. Option to send an automated series of emails
After adding a template (Step 5), you can send a series of automations. For instance, a date could be selected as a starting condition of the series. Let’s say, we pick the first order anniversary as the date and an email with a special offer as the first element of the automated series.
After this email has been sent on the specified date, there is an option to send a webhook. This way a special variable will be automatically added for the subscriber on the mailing list, depending on their actions with the email — they may open it, unsubscribe, or mark it as spam.
This way, you can set the transfer of data on your subscribers’ actions with the email and forward it to your system. These results can be used in your further work with the customers.
What’s in the outcome
API simplifies complex cooperation between systems. A user doesn’t have to process a large volume of data for each system because API lets the systems cooperate, facilitating the marketer’s job. Show this article to a web developer and just start integrating SendPulse with your project via API.