I'm currently using the Marketing Cloud SOAP API to get metrics about emails I send out. This works fine, I am able to get single instances of every event, but
I am struggling with relating the send back to the email template used for the email.
I am able to send a retrieve request to get all email templates with the following request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<fueloauth xmlns="https://exacttarget.com">***AUTH_TOKEN HERE***</fueloauth>
</soapenv:Header>
<soapenv:Body>
<RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
<RetrieveRequest>
<ObjectType>Email</ObjectType>
<Properties>ID</Properties>
<Properties>Name</Properties>
<Properties>Subject</Properties>
<Properties>Status</Properties>
<Properties>PartnerKey</Properties>
<Properties>CreatedDate</Properties>
<Properties>Folder</Properties>
<Properties>CategoryID</Properties>
<Properties>EmailType</Properties>
<!--<Properties>HTMLBody</Properties>-->
<Properties>ContentAreas</Properties>
</RetrieveRequest>
</RetrieveRequestMsg>
</soapenv:Body>
</soapenv:Envelope>
And I can get metrics for each event such as Open, clicks, unsubscribes, etc. with the following request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<fueloauth xmlns="https://exacttarget.com">***AUTH_TOKEN HERE***</fueloauth>
</soapenv:Header>
<soapenv:Body>
<RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
<RetrieveRequest>
<!-- Replace SentEvent with other desired metrics -->
<ObjectType>SentEvent</ObjectType>
<Properties>SubscriberKey</Properties>
<Properties>TriggeredSendDefinitionObjectID</Properties>
<Properties>SendID</Properties>
<Properties>BatchID</Properties>
<Properties>EventType</Properties>
</RetrieveRequest>
</RetrieveRequestMsg>
</soapenv:Body>
</soapenv:Envelope>
Is there any possible way to relate the data I get for the metrics back to the email template that was used. Is there a property that I am missing?
Thanks you.