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, 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, Suppression List from 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 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 name | Description | Data type | Is required? |
---|---|---|---|
apikey | This is the API key . You can get API key from your Netcore panel by going to Profile > User profile section. | String | Yes |
campaign_name | This 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. | String | Yes |
tags | These 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 - _ & @ | Array | Optional |
template_id | This is the ID of the APN template created on the Netcore panel. E.g. 322 | Integer | Yes |
schedule_date | This is the campaign schedule date. If campaign_status = “send now”, this value needs to be blank as campaign will be scheduled immediately If campaign_status = “send later”, this value will be mandatory and campaign will be executed at this specified date and time. | Date | Needs to be blank for campaign_status = send now Mandatory for campaign_status = send later |
API Response code and description:
Response Code | Description |
---|---|
200 | Campaign created successfully with campaign id 123 |
204 | Request body is empty |
400 | Bad request |
401 | Unauthorized request |
500 | Internal server error. Please try again |
611 | Please provide valid app id |
612 | Please provide valid channel name |
613 | Please provide valid campaign name. Allowed characters are 0-9 a-z A-Z - _ & @. Maximum character limit is 100 |
614 | Please provide valid campaign status. Possible values are draft, send now, send later |
621 | Invalid list ID. Please ensure that provided list ID exists on your Netcore panel |
622 | Invalid segment ID. Please ensure that provided segment ID exists on your Netcore panel |
623 | Invalid suppression list ID. Please ensure that provided suppression list ID exists on your Netcore panel |
624 | Invalid suppression segment ID. Please ensure that provided suppression segment ID exists on your Netcore panel |
625 | Invalid UDT ID. Please ensure that provided UDT ID exists on your Netcore panel |
626 | Please provide audience criteria. Select either all users or specific segment, list or UDT. |
627 | UDT feature is not enabled. Please enable UDT feature for your Netcore panel. |
631 | Invalid template id. Please ensure that provided template ID exists on your Netcore panel |
641 | Please provide valid schedule date. Please ensure it is greater than current date and time. |
642 | Please provide valid TTL (Time to live). Please ensure it is greater than current date and time and with in next 28 days. |
643 | Please provide valid cut-off time. Please ensure it is greater than current date and time. |
644 | Both TTL and Cut-off time values can't be set for a campaign. Please remove one of them |
645 | Since best effort is not enabled for the account, cutoff time is not accepted. Please configure best effort first |
651 | Draft campaign id provided is not valid. Please ensure provided campaign id exists on your Netcore panel and is in "Draft" state |
661 | Invalid revenue parameter for conversion event |
662 | Invalid conversion event specified |
663 | The revenue parameter specified for the conversion event is incorrect |
664 | For the mentioned conversion event, we couldn't find any payload mentioned under conversion rule block |
665 | For the mentioned conversion event, we couldn't find the specified payload parameter mentioned under conversion rule block |
666 | Value specified under conversion rule block cannot be blank |
667 | Data type for the specified payload parameter is incorrect |
668 | Condition for the specified payload parameter is incorrect |
669 | Conversion revenue without conversion event is not allowed |
670 | Conversion rules without conversion event is not allowed |
680 | Schedule date should be empty if campaign status is send now |
681 | Please provide valid tags. You can add upto 5 tags with 15 characters and allowed characters are 0-9 a-z A-Z - _ & @ |
Updated 28 days ago