Email Campaign content

An email campaign is a set of email messages. They are generally deployed with a specific purpose. Each campaign requires a well-written subject line, focused content, and a specific call to action to achieve the campaign’s goal.

Creating

  • This API endpoint allows you to create the campaign content.
  • You can send POST request to campaign/{campaign_id}/email API.
  • Taximail API will return email_id.

POST https://api.taximail.com/v2/campaign/{campaign_id}/email

Example Request

POST v2/campaign/315/emai HTTP/1.1
Host: api.taximail.com
Authorization: "Bearer YOUR_SESSION_ID"

Example Result

{
    "status": "success",
    "code": 201,
    "data": {
              "email_id": 226
       }
}

Fields

Name Type Description
status enum {success, error} Returns the status of the result.
code integer Returns the response code of the result.
err_msg string When error occur, returns the error's detail of the result.
data.email_id integer The email_id of the new email content record in campaign.

Response Code

Code Result Description
200 success Response to a successful request.
400 error The request is malformed or missing some required parameters.
401 error Unauthorized or the session_id expired.
403 error This campaign is not A/B split testing, can't create more email.
Can't manage email, campaign status is not on draft.
404 error The campaign not found.

Showing

  • This API endpoint allows you to get all email content of each campaign.
  • You can send GET request to campaign/{campaign_id}/email API.

GET https://api.taximail.com/v2/campaign/{campaign_id}/email

Example Request

GET v2/campaign/315/email HTTP/1.1
Host: api.taximail.com
Authorization: "Bearer YOUR_SESSION_ID"

Example Result

{
    "status": "success",
    "code": 200,
    "data": [
          {
                "email_id": 2162,
                "subject": null,
                "from_name": null,
                "from_email": null,
                "reply_name": null,
                "reply_email": null,
                "status_content": "not_complete"
          },
          {
                "email_id": 2163,
                "subject": "This is subject",
                "from_name": "john",
                "from_email": "john@gmail.com",
                "reply_name": "sarah",
                "reply_email": "sarah@gmail.com",
                "status_content": "complete"
          }
    ]
}

Fields

Name Type Description
status enum {success, error} Returns the status of the result.
code integer Returns the response code of the result.
err_msg string When error occur, returns the error's detail of the result.
data.email_id interger The email's id.
data.subject string The email's subject.
data.from_name string The sender's name.
data.from_email string The sender's email address.
data.reply_name string The reply's name.
data.reply_email string The reply's email address.
data.status_content string The email content status created.

Response Code

Code Result Description
200 success Response to a successful request.
400 error The request is malformed or missing some required parameters.
401 error Unauthorized or the session_id expired.
404 error The list not found.

Campaign detail

  • This API endpoint allows you to get all the details of each Campaign.
  • You can send GET request to campaign/{campaign_id}/email/{email_id} API.
  • Taximail API will return email object data such as email_id , subject , from_email and other.

GET https://api.taximail.com/v2/campaign/{campaign_id}/email/{email_id}

Example Request

GET v2/campaign/315/email/226 HTTP/1.1
Host: api.taximail.com
Authorization: "Bearer YOUR_SESSION_ID"

Example Result

{
    "status": "success",
    "code": 200,
    "data": {
                "email_id": 2162,
                "subject": "This is subject",
                "from_name": "john",
                "from_email": "john@gmail.com",
                "reply_name": "sarah",
                "reply_email": "sarah@gmail.com",
                "content_html": "...",
                "content_plain": "..."
          }
}

Fields

Name Type Description
status enum {success, error} Returns the status of the result.
code integer Returns the response code of the result.
err_msg string When error occur, returns the error's detail of the result.
data.email_id interger The email's id.
data.subject string The email's subject.
data.from_name string The sender's name.
data.from_email string The sender's email address.
data.reply_name string The reply's name.
data.reply_email string The reply's email address.
data.content_html string Return the html response template.
data.content_plain string Return the response template.

Response Code

Code Result Description
200 success Response to a successful request.
400 error The request is malformed or missing some required parameters.
401 error Unauthorized or the session_id expired.
404 error The list not found.

Updating

  • This API endpoint allows you to update campaign content.
  • You can PUT the object data such as subject , from_name , from_email and other to campaign/{campaign_id}/email/{email_id} API.

PUT https://api.taximail.com/v2/campaign/{campaign_id}/email/{email_id}

Parameter Type Description Required
session_id string The session_id from Authentication API. Yes
subject string The email's subject. Yes
from_name string From name of the email. Yes
from_email string From email address of the email. Yes
reply_name string Reply to name of the email. Yes
reply_email string Reply to email address of the email. Yes
template_key string Template key for email template. Yes

Example Request

PUT v2/campaign/315/email/226 HTTP/1.1
Host: api.taximail.com
Authorization: "Bearer YOUR_SESSION_ID"

subject=This+is+subject&from_name=john&from_email=john%40gmail.com&reply_name=sarah&reply_email=sarah%40gmail.com&template_key=1655f9358c49468

Example Result

{
    "status": "success",
    "code": 200
}

Fields

Name Type Description
status enum {success, error} Returns the status of the result.
code integer Returns the response code of the result.
err_msg string When error occur, returns the error's detail of the result.

Response Code

Code Result Description
200 success Response to a successful request.
400 error The request is malformed or missing some required parameters.
401 error Unauthorized or the session_idexpired.
404 error The campaign not found.
The email not found.
The template key not found.

Preview campaign

  • This API endpoint allows you to preview the email content.
  • You can send POST request to campaign/{campaign_id}/email/{email_id}/preview API.

POST https://api.taximail.com/v2/campaign/{campaign_id}/email/{email_id}/preview

Parameter Type Description Required
preview_email string List of email who want to receive preview email Limit 5 email separate by comma.

Ex. "preview01@example.com,preview02@example.com"
Yes

Example Request

POST v2/campaign/315/email/226/preview HTTP/1.1
Host: api.taximail.com
Authorization: "Bearer YOUR_SESSION_ID"

preview_email=preview01%40example.com%2Cpreview0201%40example.com

Example Result

{
    "status": "success",
    "code": 200
}

Fields

Name Type Description
status enum {success, error} Returns the status of the result.
code integer Returns the response code of the result.
err_msg string When error occur, returns the error's detail of the result.

Response Code

Code Result Description
200 success Response to a successful request.
400 error The request is malformed or missing some required parameters.
Invalid email address format.
401 error Unauthorized or the session_id expired.
403 error Preview email limit 5 emails.
404 error The campaign not found.
The email not found.
Invalid email address format.

SPAM testing

  • Our tool tests your campaign against most popular spam filters.
  • It provides easy-to-read instant stats.
  • This API endpoint allows you to use Spam Asssasin.
  • You can send POST request to campaign/{campaign_id}/email/{email_id}/spam_test API.
  • Taximail API will return your email score.

GET https://api.taximail.com/v2/campaign/{campaign_id}/email/{email_id}/spam_test

Example Request

GET v2/campaign/315/email/226/spam_test HTTP/1.1
Host: api.taximail.com
Authorization: "Bearer YOUR_SESSION_ID"

Example Result

{
    "status": "success",
    "code": 200,
    "data": {
              "total_score": "10",
              "require_score": "5.0",
              "rule_data": [
                    {
                          "pts": "2.4",
                          "rule_name": "ONLINE_PHARMACY",
                          "description": "BODY: Online Pharmacy"
                    },
                    {
                          "pts": "1.2",
                          "rule_name": "TVD_VISIT_PHARMA",
                          "description": "BODY: No description available."
                    },
                    {
                          "pts": "3.1",
                          "rule_name": "SUBJ_AS_SEEN",
                          "description": "Subject contains \"As Seen\""
                    },
                    {
                          "pts": "3.0",
                          "rule_name": "SUBJ_YOUR_FAMILY",
                          "description": "Subject contains \"Your Family\""
                    },
                    {
                          "pts": "0.3",
                          "rule_name": "FROM_LOCAL_HEX",
                          "description": "From: localpart has long hexadecimal sequence"
                    }
              ]
      }
}

Fields

Name Type Description
status enum {success, error} Returns the status of the result.
code integer Returns the response code of the result.
err_msg string When error occur, returns the error's detail of the result.
data.total_score float Return summary score of campaign content.
data.require_score float Return summary score of required.
data.rule_data object Return summary score of rules data.

Response Code

Code Result Description
200 success Response to a successful request.
400 error The request is malformed or missing some required parameters.
401 error Unauthorized or the session_id expired.
404 error The campaign not found.
The email not found.

Deleting

  • This API endpoint allows you to delete a campaign
  • You can send DELETE to campaign/{campaign_id}/email/{email_id} API.

DELETE https://api.taximail.com/v2/campaign/{campaign_id}/email/{email_id}

Example Request

DELETE v2/campaign/315/email/226 HTTP/1.1
Host: api.taximail.com
Authorization: "Bearer YOUR_SESSION_ID"

Example Result

{
    "status": "success",
    "code": 200
}

Fields

Name Type Description
status enum {success, error} Returns the status of the result.
code integer Returns the response code of the result.
err_msg string When error occur, returns the error's detail of the result.

Response Code

Code Result Description
200 success Response to a successful request.
400 error The request is malformed or missing some required parameters.
401 error Unauthorized or the session_id expired.
403 error Can't delete campaign content.
404 error The campaign not found.
The email not found.

Duplicating

  • This API endpoint allows you to duplicate campaign content with old campaign content.
  • You send POST request to campaign/{campaign_id}/email/{email_id}/duplicate API.
  • Taximail API will return the new email_id but new email content is the same as the old one.

POST https://api.taximail.com/v2/campaign/{campaign_id}/email/{email_id}/duplicate

Example Request

POST v2/campaign/315/email/226/duplicate HTTP/1.1
Host: api.taximail.com
Authorization: "Bearer YOUR_SESSION_ID"

Example Result

{
    "status": "success",
    "code": 201,
    "data": {
                "email_id": 2642
          }
}

Fields

Name Type Description
status enum {success, error} Returns the status of the result.
code integer Returns the response code of the result.
err_msg string When error occur, returns the error's detail of the result.
data.email_id integer The email_id of the new email content record in campaign.

Response Code

Code Result Description
201 success The new resource was created successfully.
400 error The request is malformed or missing some required parameters.
401 error Unauthorized or the session_id expired.
403 error This campaign is not A/B split testing, can't duplicate campaign.
404 error The campaign not found.
The campaign not found.
Title
Title SEO [Optional]
Description SEO [Optional]
Friendly URL [Optional]
IFRAME Content [Optional]
Priority
Markdown
We use cookies
This website uses cookies to enhance your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from. You can manage your preferences by clicking Change Preferences. Learn more about this on Cookie policy
Change Preferences
Accept All