Get Sent Emails
Lets you retrieve sent emails within a specified date range.
- The FromDate and ToDate parameters are mandatory.
- The EmailEvent parameter accepts the following values –
- Sent, EmailOpen, EmailClick, EmailUnsubscribe, EmailManageSubscriptions, EmailViewInBrowserLinkClick, EmailReSubscribe
- Sent is the default value.
- The response returns the total number of records and data of each record.
API URL
Request
Content-Type: application/json{ "Parameter":{ "FromDate":"2017-01-11 12:13:44", "ToDate":"2022-07-11 12:13:44", "EmailEvent":"Sent" }, "Paging":{ "PageIndex":1, "PageSize":10 } }
Request Parameters
Parameter | Description |
---|---|
FromDate | The start date from which you want to retrieve emails. The format must be yyyy-MM-dd HH:mm:ss |
ToDate | The end date you want to retrieve emails till. The format must be yyyy-MM-dd HH:mm:ss |
EmailEvent | The type of email event you want to retrieve. Accepted values are – Sent, EmailOpen, EmailClick, EmailUnsubscribe, EmailManageSubscriptions, EmailViewInBrowserLinkClick, EmailReSubscribe |
Paging | The results matching your criteria may be large. You can fetch the result in blocks of “PageSize” and make multiple calls to the API with increasing values of “PageIndex”. For example, you can specify “PageIndex”: 1, “PageSize”: 100 for the first call and specify “PageIndex”: 2, “PageSize”: 100 for second call. |
Response
{ "TotalRecords":2, "Records":[ { "EmailId":"5e5e2ce6-7a29-412b-a5be-5e4a2140f103", "RelatedProspectId":"ccd23f9a-e34f-4979-92f7-bb64d330c99c", "FromEmail":"virkdsingh@leadsquared.com", "RecipientEmailFields":"EmailAddress", "RecipientEmailIds":"lakshman@leadsquared.com", "Subject":"Test Email", "Content_Html":"Hi,
This is a test email. Please ignore it.
Sincerely,
LeadSquared Test", "Content_Text":"Hi,This is a test email. Please ignore it.Sincerely,LeadSquared Test", "SentOn":"2019-03-05 09:29:45" }, { "EmailId":"f05c99c4-bf9f-47b7-9953-c18a642912e5", "RelatedProspectId":"9b36d450-7dd0-4fb3-af2c-84c37e6393fe", "FromEmail":"virkdsingh@leadsquared.com", "RecipientEmailFields":"EmailAddress", "RecipientEmailIds":"vir.k.d.singh@example.com", "Subject":"Hello", "Content_Html":"hello
Sent through LeadSquared.
", "Content_Text":"Hey ThereSent through Leadsquared", "SentOn":"2017-09-08 07:13:18" } ] }
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. |