Email Campaign

Campaigns are like broadcast emails which are sent out to a list of contacts. It is a marketing message that you share through email.

They automate a lot of manual workflows.

  • It builds customer loyalty, nurtures leads, and increases direct sales.
  • It improves brand awareness every time a recipient clicks on your email.
  • It automates sending bulk emails which are time-consuming processes.
  • It can help you to split-test campaigns and measure ROI with clear metrics.

You can also observe in real time how the campaign is performing and change the campaign at once for a better outcome.

If you’re not using campaign in your email marketing efforts, you’re undermining your campaign’s full potential. The following description will help you get a better understanding of some of the functionalities.

Showing

  • This API endpoint allows you to get all campaign list.
  • You can send GET request and campaign filter to /campaign API.
  • Taximail API will return all campaign list such as campaign_count and an array of campaigns data.

GET https://api.taximail.com/v2/campaign

Parameter Type Description Required
campaign_status enum {Sent, Outbox, Draft, Paused, Scheduled, Repeatly, PendingApproval} Status of campaigns to retrieve. Yes
order_by enum {campaign_name, create_date, sent_success_date} Specify the column which is used to sort the result-set.

Defaults to create_date.
order_type enum {asc, desc} To sort the records in a ascending or descending order.

Defaults to desc.
page integer Specify the page number for reading result.

Defaults to 1.
limit integer The number of items to return per page, up to a maximum of 100.

Defaults to 25.

Example Request

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

Example Result

{
    "status": "success",
    "code": 200,
    "data": {
              "campaign_count": 3,
              "max_page": 1,
              "campaigns": [
                    {
                          "campaign_id": 1620,
                          "campaign_status": "Sent",
                          "campaign_name": "My Campaign A",
                          "ab_mode": "F",
                          "email_id": 1764,
                          "date_time": "2015-12-08 11:48:04",
                          "sent_count": 2000,
                          "preview_campaign": "http://corporate-name.th.listmng.com/b/16/1620",
                          "opened": 20
                    },
                    {
                          "campaign_id": 1621,
                          "campaign_status": "Sent",
                          "campaign_name": "My Campaign B",
                          "ab_mode": "F",
                          "email_id": 1765,
                          "date_time": "2015-12-08 11:48:04",
                          "sent_count": 3000,
                          "preview_campaign": "http://corporate-name.th.listmng.com/b/16/1621",
                          "opened": 20
                    },
                    {
                          "campaign_id": 1622,
                          "campaign_status": "Sent",
                          "campaign_name": "My Campaign C",
                          "ab_mode": "F",
                          "email_id": 1766,
                          "date_time": "2015-12-08 11:48:04",
                          "sent_count": 10000,
                          "preview_campaign": "http://corporate-name.th.listmng.com/b/16/1622",
                          "opened": 20
                    }
              ]
        }
}

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.campaign_count integer The summary campaign.
data.max_page integer The max page campaign request.
data.campaigns array The array of campaign 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.

Creating

  • This API endpoint allows you to create a new campaign.
  • You can send POST request to /campaign API.
  • Taximail API will return the new campaign_id and new email_id.

POST https://api.taximail.com/v2/campaign

Parameter Type Description Required
split_testing enum {enable, disable} This parameter is to enable or disable A/B Split Test. Yes

Example Request

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

split_testing=enable

Example Result

{
    "status": "success",
    "code": 201,
    "data": {
              "campaign_id": 315,
              "email_id": [224, 225]
       }
}

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.campaign_id integer The campaign_id of the newly created campaign.
data.email_id array 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.

Campaign detail

  • This API endpoint allows you to get campaign's detail.
  • You can send GET request to campaign/{campaign_id} API.
  • Taximail API will return campaign object such as campaign_trigger_type , campaign_name , campaign_info_status , custom_campaign_trigger and etc.

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

Parameter Type Description Required
select_mode enum {Edit, Overview, Opens, Clicks,
Browser, Unsubscriptions}
The mode for campaign detail. Yes
limit_date integer Day period of select mode campaign data.

Default to 30.

Example Request

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

Example Result

{
    "status": "success",
    "code": 200,
    "data": {
              "campaign_trigger_type": "default",
              "campaign_ref_tag": "campaign_a",
              "custom_campaign_trigger": {
                     "campaign_trigger_open_click": "none",
                     "campaign_trigger_bounce": "",
                     "campaign_trigger_drop": "",
                     "campaign_endpoint_url": "",
                     "campaign_trigger_format": "json"
              },
              "split_testing": "F",
              "split_test_status": "F",
              "campaign_name": "Campaign A",
              "campaign_status": "Sent",
              "send_mode": "Immediate",
              "campaign_info_status": "Sent"
       }
}

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.campaign_trigger_type string The webhooks type.
data.campaign_ref_tag string The reference tag each campaign.
data.custom_campaign_trigger object Return object of webhooks data.
data.split_testing string Return A/B split testing mode.
data.split_test_status string Return status of A/B split testing mode.
data.campaign_name string The campaign's name.
data.campaign_status string The campaign's status.
data.send_mode string The campaign's send mode.
data.campaign_info_status string The campaign's info status.

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.
404 error The campaign not found.

Updating

  • This API endpoint, allows you to update a campaign.
  • You can PUT the object data such as campaign_name , campaign_status and other to campaign/{campaign_id} API.

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

Parameter Type Description Required
campaign_name string The campaign's name. Yes
campaign_status enum {Draft, Ready} Set the campaign status. Yes
high_priority boolean Taximail will send their first.
test_size interger Percent of delivered campaign recipients.

Use in case A/B mode
Yes
winner integer Status of campaign winner.

Use in case A/B mode
Yes
test_duration string Duration after testing delivered campaign.

Ex. "1h","2h","1d" or "3d"

Use in case A/B mode
Yes
lists_and_segments string Target subscriber lists and segments. Each segment and list is seperated by comma.

Ex. "827:0,827:5"
Yes
schedule_type enum {Not Scheduled,
Immediate, Future,
Recursive}
Type of the schedule.
send_date date Date to send campaign.

Use in case Scheduled equal Future
Yes
send_time time Time to send campaign.

Use in case Scheduled equal Future
Yes
rec_mode enum {everyday, monday,
tuesday, wednesday,
thursday, friday, saturday,
sunday, date_of_month}
Recursive mode.

Use in case Scheduled equal Recusive
Yes
rec_date integer Date to send campaign.

Use in rec_mode equal date_of_month
Yes
rec_time time Time to send campaign.

Use in case Scheduled equal Recusive
Yes
trigger_type enum {default, custom} Type of trigger data, if default is use trigger data from Webhooks in Settings.
trigger_format enum {json, xml} Trigger data format.

Use in trigger_type equal custom
Yes
trigger_open_click enum {none, unique, full} Send webhooks type.

Use in trigger_type equal custom
Yes
trigger_url string Webhooks url.

Use in trigger_type equal custom
Yes
campaign_ref_tag string Reference name for tracking, send with trigger data.
enable_google_analytics boolean Enable or Disable to track with Google Analytics.
google_custom_tag string Reference name for tracking with Google Analytics, if enabled Google Analytics.

Example Request

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

campaign_name=MyCampaign&campaign_status=Ready&high_priority=false&lists_and_segments=191%3A0&schedule_type=Future&send_date=2016-12-30&send_time=13%3A00%3A00&trigger_type=custom&trigger_format=json&trigger_open_click=unique&trigger_url=https%3A%2F%2Fmy.webservice.com%2Fcallback_trigger&campaign_ref_tag=my_campaign&enable_google_analytics=false

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.
Please setting default campaign trigger.
Your email content is not complete.
Missing recipient / segment.
401 error Unauthorized or the session_id was expired.
404 error The campaign not found.
503 error Can't change campaign status.
Can't update campaign.
Can't send campaign because invalid campaign setting or email content is not complete.

Deleting

  • This API endpoint, allows you to delete a campaign.
  • You can send a DELETE request to campaign/{campaign_id} API.
  • Here, the campaign is deleted one by one.

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

Example Request

DELETE v2/campaign/315 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.
401 error Unauthorized or the session_id expired.
404 error 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