Application Programming Interface
There are two ways in which you can send emails using ZeptoMail :
- Email Sending with SMTP
- Email Sending with API
API
API or Application Programming Interface acts as a connection between two applications or softwares. This allows business or app owners to access the functionalities of other applications by just making API calls to them.
You can use ZeptoMail's REST APIs to send emails via ZeptoMail. To do so, you should send an API request to https://api.zeptomail.com/v1.1/email. To authorize your request, you need to add the Send mail token in the header section.
Steps to generate the Send mail token :
Application developers can authenticate API requests to ZeptoMail by adding an authorization parameter as shown below in the header section. This is the Send Mail Token (a unique token for every Mail Agent) that you can generate in your ZeptoMail account. If API requests are made to ZeptoMail without these headers, you will receive HTTP response "401 Unauthorised" error.
Authorization - zoho-enczapikey <space> <send mail token>
Steps to generate Send Mail Token :
- Navigate to the Setup info section within your Mail Agent.
- Copy the Send Mail token or generate a new one.
API error codes : The commonly intercepted errors while using APIs can be found here. This will help you better handle them.
ZeptoMail offers the following APIs :
Email sending API : The email API in ZeptoMail allows you to send emails directly from your application. Refer our email API help document to get started.
Templates API : You can also use APIs to send emails using templates. This help page gives you information on creating templates. You will require the template ID apart from the Send Mail token that has been generated.The templates API can be used to send single emails or batch emails.
The templates APIs available also provide you with the CRUD functionalities, thus allowing you to:
- Add a template.
- Fetch a particular template.
- List templates available in your ZeptoMail account.
- Edit existing templates.
- Delete templates.
The steps to generate OAuth token and use them are available in the following section.
File cache upload API : You can attach files to your emails using the file cache key to your code. Refer this page to know more about attaching files to your emails.
Mail Send API - JSON format
JSON messages are passed in the request body. You can go to API documentation section to view:
Note:
Before you get started it is important to know that ZeptoMail is for sending transactional emails like welcome emailers, password resets emails, OTPs. We do not support sending of bulk emails or promotional emails like newsletters or marketing campaign emails. If you are looking for a bulk email provider, you can visit Zoho Campaigns.