- What's new
InboxReady x Salesforce: The Key to a Stronger Email Deliverability
We know Mailgun users want to know what’s going on with their email. Back in May, we made some significant updates to our dashboard allowing users to check the delivery performance of their email. Today, we’re pleased to announce updates to our Stats API providing users the opportunity to capture more data about their emails.
We’ve updated our stats API with new features that will help Mailgun users track the status of their emails at a more granular level. The new API can now return data in chronological order with a specified resolution. Monthly, daily and hourly resolutions are now supported.
We’ve also extended the tags API so it’s now possible to provide an optional description to a tag through the API. With this update, you can also list all tags.
The Stats API for each tag are now supported and show the number of unique clicks and opens.
With this update, Mailgun users will now be able to:
Request stats for a particular event and tag
Supply an optional description of a tag
View stats at a more granular level, including hourly resolution
We use the same API to display our main dashboard in the Mailgun control panel. You can read more about it here.
For example, if you want to draw a graph that we have on the dashboard page for a domain example.com here is an idea on how to get the data series:
1import requests23def _get_stats(): 4 """Call Mailgun API to get the domain stats.""" 5 return requests.get( "https://api.mailgun.net/v3/example.com/stats/total", 6 auth=("api", "YOUR_API_KEY"), 7 params={"event": ["accepted", "delivered", "failed"], "duration": "30d"}) 89def get_series_for_graph(): 10 """Returns the data series required for drawing a nice graph.""" 11 # Make a request to the API. 12 response = _get_stats() 1314 # Prepare empty data series. 15 series = {"Delivered": [], "Dropped": [], "Incoming": []} 1617 # Iterate over all items in the response where 18 # each item represents stats for a particular day. 19 for item in response["stats"]: 20 series["Delivered"].append(item["delivered"]["smtp"]) 21 series["Dropped"].append(item["failed"]["permanent"]["total"]) 22 series["Incoming"].append(item["accepted"]["incoming"]) 2324return series
Check our out documentation and if you have a question, feel free to leave a comment!
https://documentation.mailgun.com/api-stats.html
https://documentation.mailgun.com/api-tags.html
Last updated on August 28, 2020
InboxReady x Salesforce: The Key to a Stronger Email Deliverability
Announcing InboxReady: The deliverability suite you need to hit the inbox
Mailgun Joins Sinch: The Future of Customer Communications Is Here
Email’s Not Dead Season 3 Is Finally Here
Celebramos el Mes de la Herencia Hispana
Sinch to Acquire Mailgun, Creating a Best-Of-Breed Cloud Communications Platform
Continuing Our Commitment: HTTPS Innovation And Optimization
Apple Mail Privacy Protection: Is Email Marketing Dying Again?
Welcoming Email on Acid to the Pathwire Family
Mailgun Validations Now Supports Alias and Long-term Disposable Address Identification
InboxReady x Salesforce: The Key to a Stronger Email Deliverability
Become an Email Pro With Our Templates API
Google Postmaster Tools: Understanding Sender Reputation
Navigating Your Career as a Woman in Tech
Implementing Dmarc – A Step-by-Step Guide
Email Bounces: What To Do About Them
Announcing InboxReady: The deliverability suite you need to hit the inbox
Black History Month in Tech: 7 Visionaries Who Shaped The Future
How To Create a Successful Triggered Email Program
Designing HTML Email Templates For Transactional Emails
InboxReady x Salesforce: The Key to a Stronger Email Deliverability
Implementing Dmarc – A Step-by-Step Guide
Announcing InboxReady: The deliverability suite you need to hit the inbox
Designing HTML Email Templates For Transactional Emails
Email Security Best Practices: How To Keep Your Email Program Safe
Mailgun’s Active Defense Against Log4j
Email Blasts: The Dos And Many Don’ts Of Mass Email Sending
Email's Best of 2021
5 Ideas For Better Developer-Designer Collaboration
Mailgun Joins Sinch: The Future of Customer Communications Is Here
Always be in the know and grab free email resources!
By sending this form, I agree that Mailgun may contact me and process my data in accordance with its Privacy Policy.