Skip to content

Retrieving Message Statistics

Andrew Theken edited this page Dec 12, 2014 · 3 revisions

The Postmark API allows you to gain powerful insights into the deliverability and effectiveness of the email you send. The PostmarkClient supports retrieving these statistics through the API.

Get Outbound Overview:

var client = new PostmarkClient("<server token>");

var outboundOverviewStats = await client
	.GetOutboundOverviewStatsAsync("tag1",
        DateTime.UtcNow - TimeSpan.FromDays(3), 
        DateTime.UtcNow);

Get Sent Counts:

var client = new PostmarkClient("<server token>");

var outboundSentCounts = await client
	.GetOutboundSentCountsAsync("tag1",
		DateTime.UtcNow - TimeSpan.FromDays(3), 
		DateTime.UtcNow)

Get Bounce Counts:

var client = new PostmarkClient("<server token>");

var outboundBounceCounts = await client
	.GetOutboundBounceCountsAsync("tag1",
        DateTime.UtcNow - TimeSpan.FromDays(3), 
        DateTime.UtcNow)

Get SPAM Complaints:

var client = new PostmarkClient("<server token>");

var spamComplaints = await client
	.GetOutboundSpamComplaintCountsAsync("tag1",
		DateTime.UtcNow - TimeSpan.FromDays(3),
        DateTime.UtcNow)

Get Tracked Email Counts:

var client = new PostmarkClient("<server token>");

var trackingCounts = await client
	.GetOutboundTrackingCountsAsync("tag1",
		DateTime.UtcNow - TimeSpan.FromDays(3),
		DateTime.UtcNow)

Get Open Counts:

var client = new PostmarkClient("<server token>");

var openCounts = await client
	.GetOutboundOpenCountsAsync("tag1",
        DateTime.UtcNow - TimeSpan.FromDays(3),
        DateTime.UtcNow);

Get Platform Usage:

var client = new PostmarkClient("<server token>");

var platformUsage = await client
	.GetOutboundPlatformCountsAsync("tag1",
        DateTime.UtcNow - TimeSpan.FromDays(3),
        DateTime.UtcNow);

Get Client Usage:

var client = new PostmarkClient("<server token>");

var mailClientCounts = await client
	.GetOutboundClientUsageCountsAsync("tag1",
            DateTime.UtcNow - TimeSpan.FromDays(3),
            DateTime.UtcNow);

Get Read Times:

var client = new PostmarkClient("<server token>");

var readTimes = await client
	.GetOutboundReadtimeStatsAsync("tag1",
		DateTime.UtcNow - TimeSpan.FromDays(3),
		DateTime.UtcNow);
Clone this wiki locally