Send an Email Campaign
Lets you send an email campaign to a list of leads. Once the campaign is scheduled, you can view the campaign details under Marketing>Email Campaign.
Note: The report for email campaigns sent through this API will be available 20 minutes after the campaign is sent.
API URL
Request
Content-Type: application/json{ "EmailLibraryName":"Email template name", "SenderType":"User", "From_UserIdEmailAddress":"Sender email address", "ListId":" Mention the list ID", "Schedule":"2017-07-13 11:06:00", "EmailCampaignName":"Campaign name", "IncludeEmailFooter":true, "EmailCategory":"Category name" }
Request Parameters
Parameter | Description |
---|---|
EmailLibraryName | The name of an email template (either system generated or created by you). You can find it under Email Library. |
SenderType | This parameter lets you choose how you want to pass the sender of the email. Depending on the chosen value for this parameter, you will have to pass a corresponding value in the “Sender” parameter. The “SenderType” can be passed as:
|
From_UserIdEmailAddress | Use the required administrator or marketing user email address. |
ListId | This is the unique ID of a lead’s list. To get this, refer to the Retrieve all Lists API |
Schedule | This parameter allows you to schedule the email for a later date and time. If you don’t pass this value the email will be sent immediately. |
EmailCampaignName | The name of your email campaign. For example “Merry Christmas from Example Brand”. |
IncludeEmailFooter | You can pass this value as “true” if you wish to add a footer in your email or as “false” if you don’t. |
EmailCategory | This parameter is not mandatory but you can pass the email category name if you have them created in your LeadSquared account. You can create new email categories by navigating to Settings>Email Settings on the LeadSquared UI. |
Response
{ "ID": "aef54482-6ac1-11e7-bd09-22000aa220ce", "MemberCount": 9, "TotalRecipient": 6 }
HTTP Response Codes
Code | Description |
---|---|
200 OK | This is the status code for successful API call. |
401 Unauthorized | The API call was made with invalid access credentials. Check your AccessKey and SecretKey. |
400 Bad Request | The message body on the request is not as per API specification. Make sure that content type is set to “application/json” and the JSON body has correct attribute names and structure. |
404 Not Found | The API could not be found. Please check the API signature. |
429 Too Many Requests | API calls exceeded the limit of 25 in 5 second(s) |
500 Internal Server Error | The API called failed. There could be many reasons for it. Check the exception message to get more details. |