I need to pull all TriggeredSends with the word "Confirmation" in the name of it that were sent between a specified date. The reason I need to pull by the name, and not an ID is because this is going to be used across multiple clients with different IDs. Our company has a naming standard that is used across all the accounts.
TriggeredSendSummaries have every property that I need to work with (UniqueOpens, UniqueClicks, etc). I can successfully pull the TriggeredSendSummaries of TriggeredSends, but I can't tell which TriggeredSend they are a summary of. I see that TriggeredSendDefinitions are a property of the summaries, and the definitions include the needed name I need to check for. The problem is I get an error saying that Error: The Request Property(s) TriggeredSendDefintion do not match with the fields of TriggeredSendSummary retrieve
.
I know the issue is not the Date filter because I have that working in another API call perfectly fine.
Here is my .NET code if it helps anyone:
RetrieveRequest triggeredRetrieveRequest = new RetrieveRequest();
triggeredRetrieveRequest.ObjectType = "TriggeredSendSummary";
triggeredRetrieveRequest.Properties = new String[] { "Sent", "UniqueOpens", "UniqueClicks", "CustomerKey", "TriggeredSendDefintion"}; //Fails on TriggeredSendDefinition
SimpleFilterPart dateFilter = new SimpleFilterPart();
dateFilter.Property = "SentDate";
dateFilter.SimpleOperator = SimpleOperators.between;
dateFilter.DateValue = new DateTime[2];
//Parse date strings
DateTime start = DateTime.SpecifyKind(DateTime.Parse(myStartDate + " 00:00:00.000"), DateTimeKind.Utc);
var startKind = start.Kind;
DateTime end = DateTime.SpecifyKind(DateTime.Parse(myEndDate + " 00:00:00.000"), DateTimeKind.Utc);
var endKind = start.Kind;
//Make input dates be included within the between
dateFilter.DateValue[0] = start.AddDays(-1).ToLocalTime();
dateFilter.DateValue[1] = end.AddDays(1).ToLocalTime();
//Would like to add a complex filter here to check for name of TriggeredSendDefinition name
triggeredRetrieveRequest.Filter = dateFilter;
APIObject[] triggeredResults = null;
String triggeredRequestId = null;
String triggeredResponse = soapClient.Retrieve(triggeredRetrieveRequest, out triggeredRequestId, out triggeredResults);