- 08 Dec 2023
- 4 Minutes to read
Get email analytics
- Updated on 08 Dec 2023
- 4 Minutes to read
Overview
This API enables you to get the following data from your back-end without using Insider's platform:
The email campaigns sent through Architect journeys are not included in Email Analytics. You can get insights about your journey emails via Architect Email Channel Analytics.
Get Email Campaign List
This request allows you to get a full list of your available email campaigns.
Endpoint and Headers
GET https://analytics.api.useinsider.com/email/v1/campaign/list
Headers
Header | Sample Value | Description |
---|---|---|
X-INS-AUTH-KEY | 1a2b3c4d5e6f | This key is required to authorize your request. Refer to API Authentication Tokens to generate your token. |
Query Parameters
Parameter | Data Type | Description | Required |
---|---|---|---|
page | Integer | Specifies the number of pages of email campaigns | Yes |
perPage | Integer | Specifies the number of emails to be listed per page | Yes |
Sample Example
Sample Query
Before sending the request, make sure:
- To replace the authorization value with your own API key.
- To replace the sample values in page and perPage with your own values in the required data type.
curl --location --request GET 'https://analytics.api.useinsider.com/email/v1/campaign/list?page=1&perPage=100' \
2--header 'X-INS-AUTH-KEY: 1a2b3c4d5e6f'
Sample Responses
- 200 OK
{
"currentPage": 1,
"data": [
{
"id": 67,
"campaignName": "My awesome campaign",
"startTime": "01-01-2023 12:30:15"
},
{
"id": 66,
"campaignName": "This is a great campaign",
"startTime": "01-12-2022 09:30:17"
},
{
"id": 65,
"campaignName": "This is a recurring campaign",
"startTime": "12-12-2022 12:45:15"
},
{
"id": 64,
"campaignName": "This is a newsletter",
"startTime": "22-07-2022 16:00:01"
},
{
"id": 63,
"campaignName": "My email campaign",
"startTime": "01-01-2022 18:30:00"
}
],
"firstPageUrl": "https://analytics.useinsider.com/email/v1/campaign/list?page=1&perPage=5",
"from": 0,
"lastPage": 14,
"lastPageUrl": "https://analytics.useinsider.com/email/v1/campaign/list?page=14&perPage=5",
"nextPageUrl": "https://analytics.useinsider.com/email/v1/campaign/list?page=2&perPage=5",
"path": "/email/v1/campaign/list",
"perPage": 5,
"prevPageUrl": "https://analytics.useinsider.com/email/v1/campaign/list?page=1&perPage=5",
"to": 0,
"total": 67
}
- 400 - Bad Request: Sorry, we’ve received an invalid request from your side. You can try again later.
- 400 - Bad Request: Sorry, we couldn’t validate the request at the moment. You can try again later.
- 500 - Internal Server Error: Sorry, we couldn’t receive any response from our server. You can try again later.
Get Email Campaign Analytics
This request allows you to get the analytics of your email campaigns for a given time period.
Endpoint and Headers
GET https://analytics.api.useinsider.com/email/v1/campaign/statistics
Headers
Header | Sample Value | Description |
---|---|---|
X-INS-AUTH-KEY | 1a2b3c4d5e6f | This key is required to authorize your request. Refer to API Authentication Tokens to generate your token. |
Query Parameters
Parameter | Data Type | Description | Required |
---|---|---|---|
campaignId | Integer | Your campaign ID that can be found on the campaign URL. | Yes |
startTime | int64 | The time campaign is being launched. Specifies a 10-digit epoch start time. | Yes |
endTime | int64 | The current date (today’s date on the payload). It can be customizable according to your use case. Specifies a 10-digit epoch start time. | No |
Sample Example
Sample Query
Before sending the request, make sure:
- To replace the authorization value with your own API key.
- To replace the sample values in campaignID, startTime, and endTime with your own values in the required data type.
curl --location --request GET 'https://analytics.api.useinsider.com/email/v1/campaign/statistics?campaignId=3388&startTime=1619459200&endTime=1636502400' \
2--header 'X-INS-AUTH-KEY: 1a2b3c4d5e6f'
Sample Responses
- 200 OK
{
"data": {
"details": {},
"summary": {
"blocks": 300,
"bounces": 0,
"clickRate": 1.45,
"clickToOpen": 2860,
"conversion": 22,
"conversionRate": 0.01,
"delivered": 235746,
"frequencyDrop": 0,
"invalid": 0,
"linkActivities": [
{
"totalClick": 1,
"uniqueClick": 1,
"url": "https://google.com"
}
],
"machineOpen": 0,
"openRate": 6.48,
"revenue": 0,
"sendingDrop": 0,
"sent": 236573,
"spams": 2,
"systemDrop": 0,
"totalClick": 4931,
"totalOpen": 64518,
"uniqueClick": 3429,
"uniqueOpen": 15272,
"unsubscribes": 100
}
}
}
- 400 - Bad Request: Sorry, we’ve received an invalid request from your side. You can try again later.
- 400 - Bad Request: Sorry, we couldn’t validate the request at the moment. You can try again later.
- 400 - Bad Request: Sorry, we detected an invalid Campaign ID in your request. The Campaign ID is not found in the database. You can confirm your Campaign ID by checking the InOne panel.
- 406 - Not Acceptable Request: Sorry, we received an invalid request. We are able to provide the analytics data for only the last 1 year.
- 500 - Internal Server Error: Sorry, we couldn’t receive any response from our server. You can try again later.
Get Overall Analytics
This request allows you to get the overall analytics of your email campaigns for a given time period.
Endpoint and Headers
Headers
Header | Sample Value | Description |
---|---|---|
X-INS-AUTH-KEY | 1a2b3c4d5e6f | This key is required to authorize your request. Refer to API Authentication Tokens to generate your token. |
Query Parameters
Parameter | Data Type | Description | Required |
---|---|---|---|
startTime | int64 | The time campaign is being launched. Specifies a 10-digit epoch start time. | Yes |
endTime | int64 | The current date (today’s date on the payload). It can be customizable according to your case. Specifies a 10-digit epoch start time. | No |
Sample Example
Sample Query
Before sending the request, make sure:
- To replace the authorization value with your own API key.
- To replace the sample values in start_date and end_date with your own values in the required data type.
curl --location --request GET 'https://analytics.api.useinsider.com/email/v1/overall?startTime=1635714000&endTime=1646502400' \
2--header 'X-INS-AUTH-KEY: 1a2b3c4d5e6f'
Sample Responses
- 200 OK
{
"data": {
"summary": {
"blocks": 0,
"bounceDrop": 0,
"bounces": 0,
"clickRate": 5.88,
"conversion": 0,
"conversionRate": 0,
"delivered": 17,
"frequencyDrop": 0,
"invalid": 0,
"invalidDrop": 0,
"machineOpen": 0,
"openRate": 47.05,
"revenue": 0,
"sendingDrop": 0,
"sent": 27,
"spamDrop": 0,
"spams": 0,
"systemDrop": 0,
"totalClick": 1,
"totalOpen": 15,
"unsubscribeDrop": 0,
"unsubscribes": 0
},
"linkActivities": [
{
"totalClick": 1,
"uniqueClick": 1,
"url": "https://google.com"
}
]
}
}
- 400 - Bad Request: Sorry, we’ve received an invalid request from your side. You can try again later.
- 400 - Bad Request: Sorry, we couldn’t validate the request at the moment. You can try again later.
- 429 - Rate Limited: Rate limited
- 500 - Internal Server Error: Sorry, we couldn’t receive any response from our server. You can try again later.
Limitations
- All functions must be executed with an HTTPS GET request.
- The x-ins-auth-key should be provided as the authorization key on the request header. If the key is incorrect, the operation will not be executed and an authorization error will return in the response.
- This API provides data for a 1 year-range.
- You can send 100 requests/per minute with the same API Key. If you exceed the rate limit, you will receive a 429 error.
- The perPage value should be between 1-100.