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

POST
https://{host}/v2/EmailMarketing.svc/RetrieveSentEmails?accessKey=AccessKey&secretKey=SecretKey
Copy URL

Request

JSON Body/Payload

Content-Type: application/json

{
  "Parameter": {
    "FromDate": "2019-01-11 12:13:44",
    "ToDate": "2019-11-11 12:13:44",
    "EmailEvent": "Sent"
  },
  "Paging": {
    "PageIndex": 1,
    "PageSize": 10
  }
}

JSON Properties

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

200 OK

Content-Type: application/json

{
  "TotalRecords": 3,
  "Records": [
    {
      "EmailId": "130e3dd3-171d-48c3-961f-2913d56e27d7",
      "RelatedProspectId": "af0b28ab-11eb-4307-8ffb-a9ba3e322bc3",
      "FromEmail": "himanshu@leadsquared.com",
      "RecipientEmailFields": "EmailAddress",
      "RecipientEmailIds": "himanshu@leadsquared.com",
      "Subject": "Test Email",
      "Content_Html": "Test Email",
      "Content_Text": "Test Email",
      "SentOn": "2019-02-07 03:51:09"
    },
    {
      "EmailId": "7810065e-1857-436b-be4a-4ca58909974a",
      "RelatedProspectId": "ddea28db-d994-49bd-8dc0-2cd169807305",
      "FromEmail": "himanshu@leadsquared.com",
      "RecipientEmailFields": "EmailAddress",
      "RecipientEmailIds": "himanshu@yopmail.com",
      "Subject": "Test Email",
      "Content_Html": "Test Email",
      "Content_Text": "Test Email",
      "SentOn": "2019-02-07 03:51:09"
    },
    {
      "EmailId": "d6461320-5d12-4fa7-b7d0-1816aa960a09",
      "RelatedProspectId": "28d17574-c546-11e8-a923-0af843a38b8c",
      "FromEmail": "ram@dummy.com",
      "RecipientEmailFields": "EmailAddress",
      "RecipientEmailIds": "ramakrishnan@leadsquared.com",
      "Subject": "Re: {same subject}",
      "Content_Html": "Hi ,
 
Wanted to make sure you got my earlier message. I’d like to learn about [The thing your company handles]. If you are the appropriate person to speak with, what does your calendar look like early next week? If not, who do you recommend I talk to?

– 

 


Our mailing address is:
Success - Trial Account, strett, wait 12, Bengaluru, 123123123, India
", "Content_Text": "Hi ,Wanted to make sure you got my earlier message. I’d like to learn about [The thing your company handles]. If you are the appropriate person to speak with, what does your calendar look like early next week?", "SentOn": "2019-01-15 10:26:46" } ] }

HTTP Response Code

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.