2

In the official documentation, the EmailSendDefinition object has an Email property.

The same I see in the WSDL schema:

<complexType name="EmailSendDefinition">
  <complexContent>
    <extension base="tns:SendDefinition">
      <sequence>
         ...
         <element name="Email" minOccurs="0" maxOccurs="1" type="tns:Email"/>

I am sending the following POST request:

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <s:Header>
        <a:Action s:mustUnderstand="1">Retrieve</a:Action>
        <a:To s:mustUnderstand="1">https://{{et_subdomain}}.soap.marketingcloudapis.com/Service.asmx</a:To>
        <fueloauth xmlns="http://exacttarget.com">{{dne_etAccessToken}}</fueloauth>
    </s:Header>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <Options>
        </Options>
         <RetrieveRequest>
            <ObjectType>EmailSendDefinition</ObjectType>
            <Properties>Email</Properties>
         </RetrieveRequest>
      </RetrieveRequestMsg>
    </s:Body>
</s:Envelope>

And I get:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <env:Header xmlns:env="http://www.w3.org/2003/05/soap-envelope">
        <wsa:Action>RetrieveResponse</wsa:Action>
        <wsa:MessageID>urn:uuid:...</wsa:MessageID>
        <wsa:RelatesTo>urn:uuid:...</wsa:RelatesTo>
        <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
        <wsse:Security>
            <wsu:Timestamp wsu:Id="Timestamp-...">
                <wsu:Created>2021-06-09T21:14:28Z</wsu:Created>
                <wsu:Expires>2021-06-09T21:19:28Z</wsu:Expires>
            </wsu:Timestamp>
        </wsse:Security>
    </env:Header>
    <soap:Body>
        <RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
            <OverallStatus>Error: The Request Property(s) Email do not match with the fields of EmailSendDefinition retrieve</OverallStatus>
            <RequestID>...</RequestID>
        </RetrieveResponseMsg>
    </soap:Body>
</soap:Envelope>

If instead of Email I use, for an example, EmailSubject, I get the data, but some fields are not retrievable as the Email field.

How can I distinguish retrievable and non-retrievable fields? How can I retrieve the Email of a particular EmailSendDefinition?

1 Answer 1

2

EmailSendDefinitions don't tend to get used that much these days, but you can view the retrievability/updatability of a SOAP object by using a Describe operation. The SOAPAction header needs to be "Describe". Here's a sample payload:

<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>{{_token}}</fueloauth>
   </soapenv:Header>
   <soapenv:Body>
      <DefinitionRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <DescribeRequests>
            <ObjectDefinitionRequest>
               <ObjectType>EmailSendDefinition</ObjectType>
            </ObjectDefinitionRequest>
         </DescribeRequests>
      </DefinitionRequestMsg>
   </soapenv:Body>
</soapenv:Envelope>

You'll see that "Email.ID" is a property that is retrievable. So, you can use this in your retrieve of the EmailSendDefinition.

<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>{{_token}}</fueloauth>
    </soapenv:Header>
   <soapenv:Body>
      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <RetrieveRequest>
            <ObjectType>EmailSendDefinition</ObjectType>
            <Properties>Email.ID</Properties>
         </RetrieveRequest>
      </RetrieveRequestMsg>
   </soapenv:Body>
</soapenv:Envelope>
3
  • 1
    The answer is right, I just wanted to comment because I disagree that EmailSendDefinitions don't tend to get used that much these days. Honestly, almost every single client I have uses these on a near daily basis. This is because for bulk sends using the Automation Studio Email Send (User-Initiated Send aka Email Send Definition) is best practice for scheduling bulk sends. By doing this, you remove the 'caching' of the email creative on schedule so you can update the email without requiring canceling and rescheduling of your sends. Commented Jun 10, 2021 at 13:00
  • 1
    @Gortonington My drift was, "do you want to retrieve the 'Send' object?". Yes. It's an overstretch. "almost every single client I have uses these on a near daily basis"... my ones, not so much. I'm not against, but my clients are more into consistency and can't handle too many ways of doing the same thing, bless them. They get the "techies" to sort out Automation Studio and do that "SQL stuff". Journey Builder's for them. I don't see an awful lot of ESDs being created, unless I do it for them.
    – Macca
    Commented Jun 10, 2021 at 16:54
  • 1
    Usage is contextual I will agree, I just wanted to point out they are still in use in many places. Commented Jun 10, 2021 at 17:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .