1. Home
  2. Docs
  3. REST API
  4. API Guides
  5. Get campaigns analytics

Get campaigns analytics

REST API

Retrieve contacts that were sent via SMTP, excluding those dropped for various reasons (accessible through the ‘undelivered’ function), and including those that later bounced (retrievable through the ‘activities’ function).
*When enter the contact’s number as a parameter, along with the dates for which you want to display the deliveries (if no value is provided, it returns data from the past 7 days).
Request URL
https://api.inwise.com/rest/v1/campaigns/email/sentEmails?contact_id=1111111&date_from=2019-03-01
Response Body
[
  {
    “row_index”: 6111111,
    “transaction_id”: “28111435326624654d550”,
    “contact_id”:  1111111,
    “campaign_id”: 222222,
    “date_sent”: “2019-03-18 11:26:00”,
    “email”: “XXX@inwise.com“,
    “message_size”: 56,
    “sending_source”: “Campaign”
  }
  ]

GET/campaigns/email/undelivered

The undelivered list mostly contains unsubscribed contacts and previously bounced contacts. These are excluded from the sent list

Request URL
https://api.inwise.com/rest/v1/campaigns/email/undelivered?campaign_id=1958368

Response Body

[
{
“id”: 2400463850,
“campaign_id”: 1958368,
“email”: “john@gmail.com”,
“contact_id”: 1111,
“reason”: “unsubscribed”,
“create_date”: “2024-09-02 13:55:00”
}

]

method for retrieving email details for each response:

*Make sure to provide a date range, otherwise, the method will return data only from the past week.

*Note that it returns a maximum of 1,000 rows (100 rows by default), therefore you need to iterate through the different pages using the page_index attribute to get all the results.

*You can retrieve all actions or filter by a specific action.

*Optional filter: the type of action to narrow the results. Allowed values are: ’emailOpened’, ’emailClicked’, ’emailBounced’, ’emailUnsubscribed’, ’emailWebVersion’, ’emailPublicWebVersion’, ’emailPrinted

Request URL
Response Body
[
  {
    “id”: 87111986,
    “action_date”: “2024-09-02 13:59:00”,
    “contact_id”:  1111111,
    “campaign_id”:  222222  ,
    “ip”: “80.179.11.11”,
    “action_type”: “emailOpened”,
    “remarks”: “12345”
  },
  {
    “id”: 87111985,
    “action_date”: “2024-09-02 13:59:00”,
    “contact_id”:  1111111 ,
    “campaign_id”:  222222  ,
    “ip”: “80.179.11.11”,
    “action_type”: “emailClicked”,
    “additional_data”: “https://app.inwise.com/
  },

  ]

A method that returns the ‘funnel’ – meaning, how many were sent, how many opened, how many bounced, and how many clicked.

Request URL
https://api.inwise.com/rest/v1/campaigns/email/activitiesSummary?campaign_id=1958368

Response Body
{
“opens”: 5,
“opens_unique”: 2,
“clicks”: 3,
“clicks_unique”: 2,
“sent”: 100,
“undelivered”: 62,
“bounces”: 0,
“bounces_unique”: 0,
“webversions_unique”: 1,
“unsubscribes”: 0,
“unsubscribes_unique”: 0,
“report_spam”: 0,
“report_spam_unique”: 0,
“onsite”: 0,
“onsite_unique”: 0
}

GET/campaigns/email/recentActivity

Returns similar information to GET /campaigns/email/activities, but here there’s no filtering by date or campaign. Instead, the system always returns the latest information, meaning it returns only the deltas (changes).

Request URL
https://api.inwise.com/rest/v1/campaigns/email/recentActivities

Response Body

[
{
“id”: 690504188,
“action_date”: “2024-09-17 12:31:00”,
“contact_id”: 2,
“campaign_id”: 1963715,
“ip”: “212.199.46.197”,
“action_type”: “emailOpened”
},
{
“id”: 690776464,
“action_date”: “2024-09-18 12:05:00”,
“contact_id”: 426097851,
“campaign_id”: 1962286,
“ip”: “45.112.30.172,136.226.243.10”,
“action_type”: “emailOpened”
}
]

*There are two additional Recent methods

WEHBOOK

In addition to retrieving data via the REST API, there is also the option to receive information through your webhook –

For more details on the webhook, see the guide at: https://developers.inwise.com/docs/webhook/set-up-webhook-via-automation-guide/

 

EXTERNAL ID

All methods and webhooks will return the EXTERNAL ID if you have used it, meaning the external recipient ID as you provided it.

 

How can we help?