Email Campaign API

Netcore’s Email Campaign API will be an easy non-UI dependent way to create Email campaigns. This document will help you with the details of the API signature that we are planning.

Quick summary of what you can do with this Email campaign API :

  • You can call this API when you want to create a broadcast email campaign.
  • Define campaign parameters directly in the requests such as campaign details, audience details, email template details, and scheduling conditions.
  • You get an option to schedule it directly for execution as well.

API details:

API endpoint -
US : https://api.netcoresmartech.com/apiv2?activity=upload_contact_and_publish

IND: https://apiin.netcoresmartech.com/apiv2?activity=upload_contact_and_publish

EU : https://goapiv3.eu-north-1.eu.netcoresmartech.com/apiv2?activity=upload_contact_and_publish

Method -
POST

Content-Type -
application/json

Sample Request for the Body

Using List ID, Template ID, and Suppression List from the panel

{
  "campaign_name": "Campaign API Test1",
  "subject_line": "Campaign API Test-1",
  "sender_email_id": "[email protected]",
  "replyto": "[email protected]",
  "sender_name": "Netcore",
  "schedule_date": "now",						
  "templateid": "17",		
  "target_lists": "151",
  "suppression_list":"153",
  "tags":"abc,test_tag",
  "notify_me": "[email protected]"
}

Using List ID, Suppression List from panel & Hosted HTML template from API

{
  "campaign_name": "Campaign API Test2",
  "subject_line": "Happy Diwali [NAME] 😊",
  "sender_email_id": "[email protected]",
  "replyto": "[email protected]",
  "sender_name": "Netcore",
  "schedule_date": "now",
  "source_file": "http://smtreports.netcore.co.in/jobs/mtemplate.html",
  "target_lists": "151",
  "suppression_list":"153",
  "tags":"abc,test_tag",
  "notify_me": "[email protected]"
}

Using Upload CSV & Hosted HTML template from API

{
  "campaign_name": "Campaign API Test - 3",
  "subject_line": "Hey [NAME], how are you?",
  "sender_email_id": "[email protected]",
  "replyto": "[email protected]",
  "sender_name": "Netcore",
  "schedule_date": "2020-11-12 18:15:00",
  "source_file": "http://smtreports.netcore.co.in/jobs/mtemplate.html",
  "contacts_upload_source": "http://smtreports.netcore.co.in/jobs/mylist_3.csv",
  "check_rowcount": "1",
  "list_name": "Emailapitest1",
  "tags":"abc,test_tag",
  "notify_me": "[email protected]"
}

Using Template ID from the panel, Upload CSV from API

{
  "campaign_name": "Campaign API Test - 4",
  "subject_line": "”Happy Diwali” [NAME]",
  "sender_email_id": "[email protected]",
  "replyto": "[email protected]",
  "sender_name": "Netcore",
  "schedule_date": "2020-11-12 18:30:00",
  "templateid": "17",
  "contacts_upload_source": "http://smtreports.netcore.co.in/jobs/mylist_3.csv",
  "check_rowcount": "1",
  "list_name": "Emailapitest",
  "tags":"abc,test_tag",
  "notify_me": "[email protected]"
}

API Body Payload Details:

Key nameDescriptionData typeIs required?
apikeyThis is the API key . You can get API key from your Netcore panel by going to Profile > User profile section.StringYes
campaign_nameThis is the name of the campaign. E.g. Special discount campaign.

Allowed characters are 0-9 a-z A-Z - _ & @. Maximum character limit is 100.
StringYes
tagsThese are tags added for the APN campaign. E.g. “Offer” .

You can add upto 5 tags with 15 characters and allowed characters are 0-9 a-z A-Z - _ & @
ArrayOptional
template_idThis is the ID of the APN template created on the Netcore panel. E.g. 322IntegerYes
schedule_dateThis is the campaign schedule date.

If campaign_status = “send now”, this value needs to be blank as the campaign will be scheduled immediately

If campaign_status = “send later”, this value will be mandatory and the campaign will be executed at this specified date and time.
DateNeeds to be blank for campaign_status = send now

Mandatory for campaign_status = send later

API Response code and description:

Response CodeDescription
200Campaign created successfully with campaign id 123
204The request body is empty
400Bad request
401Unauthorized request
500Internal server error. Please try again
611Please provide a valid app id
612Please provide a valid channel name
613Please provide a valid campaign name. Allowed characters are 0-9 a-z A-Z - _ & @. The maximum character limit is 100
614Please provide valid campaign status. Possible values are draft, send now, send later
621Invalid list ID. Please ensure that provided list ID exists on your Netcore panel
622Invalid segment ID. Please ensure that provided segment ID exists on your Netcore panel
623Invalid suppression list ID. Please ensure that provided suppression list ID exists on your Netcore panel
624Invalid suppression segment ID. Please ensure that provided suppression segment ID exists on your Netcore panel
625Invalid UDT ID. Please ensure that provided UDT ID exists on your Netcore panel
626Please provide audience criteria. Select either all users or a specific segment, list, or UDT.
627The UDT feature is not enabled. Please enable the UDT feature for your Netcore panel.
631Invalid template id. Please ensure that provided template ID exists on your Netcore panel
641Please provide a valid scheduled date. Please ensure it is greater than the current date and time.
642Please provide valid TTL (Time to live). Please ensure it is greater than the current date and time and within next 28 days.
643Please provide valid cut-off time. Please ensure it is greater than current date and time.
644Both TTL and Cut-off time values can't be set for a campaign. Please remove one of them
645Since best effort is not enabled for the account, cutoff time is not accepted. Please configure best effort first
651Draft campaign id provided is not valid. Please ensure provided campaign id exists on your Netcore panel and is in "Draft" state
661Invalid revenue parameter for the conversion event
662Invalid conversion event specified
663The revenue parameter specified for the conversion event is incorrect
664For the mentioned conversion event, we couldn't find any payload mentioned under conversion rule block
665For the mentioned conversion event, we couldn't find the specified payload parameter mentioned under conversion rule block
666Value specified under conversion rule block cannot be blank
667Data type for the specified payload parameter is incorrect
668Condition for the specified payload parameter is incorrect
669Conversion revenue without conversion event is not allowed
670Conversion rules without conversion event is not allowed
680Schedule date should be empty if campaign status is send now
681Please provide valid tags. You can add upto 5 tags with 15 characters and the allowed characters are 0-9 a-z A-Z - _ & @