Question

I'm trying to get all events for a specific campaign since a particular datetime.

The API is returning the same results for any begin value I specify (past or future) and I've sent 2000+ emails (with open and click tracking enabled) over the past few days.

RestClient client = new RestClient();
client.BaseUrl = "https://api.mailgun.net/v2/MYDOMAIN.com";
client.Authenticator = new HttpBasicAuthenticator("api", "MYKEY");
RestRequest request = new RestRequest();
request.Resource = "campaigns/MYCAMPAIGN/events";
request.AddParameter("begin", "Mon, 10 Feb 2014 23:59:00 -0000");
request.AddParameter("ascending", "yes");
return client.Execute(request).Content

This returns the same exact results in the same descending order no matter which datetime I specify for begin. (It seems to be returning to be the most recent events.)

Does anyone see what I'm doing wrong here?

I would like to specify a datetime and get the x oldest events that occured on or after the specified datetime in ascending order (oldest first, newest last).

Was it helpful?

Solution

The Events API does not appear to support filtering by CampaignId and the Campaign API does not appear to support filtering by date.

OTHER TIPS

Maybe, can you use tags as filter fields and put there the date information

https://documentation.mailgun.com/api-events.html#filter-field

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top