[SalesForce] ExactTarget, SOAP request problem in creating a triggered send definition

Guys I have couple of questions on ExactTarget SOAP requests, and hopefully you have the answer. Anyway thanks in advance for looking at the question.

1). My goal is to create a triggered send using ExactTarget and I believe this can be done using send_triggeredsend_email method in https://help.exacttarget.com/en/technical_library/web_service_guide/technical_articles/send_triggeredsend_email/.

Could you please correct me if I am wrong here.

  1. In order to fill the Definition_Key parameter in the request, I believe we should first send a request to creating_a_triggered_send_definition method.

But here I am constantly getting the following error.
– Exception occurred during [CreateTriggeredSendDefinition] ErrorID: 852043495

Please find the request below. Please note here I uses the details retrieved from retrieving_dataextension_object method as customer key, etc.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Header>
      <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken>
            <wsse:Username>XXXXX</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXXXX</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </SOAP-ENV:Header>
   <SOAP-ENV:Body>
      <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <Options/>
         <Objects xsi:type="TriggeredSendDefinition">            
            <SendClassification>
               <PartnerKey xsi:nil="true"/>
                <ObjectID>29767c11-2281-e411-aea6-38eaa71427a1</ObjectID>
                <CustomerKey>testDataExtension</CustomerKey>
            </SendClassification>            
         </Objects>
      </CreateRequest>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Best Answer

In order to create and send a triggered send through the API - there are a few steps you have to go through to get there. You can set up the triggered send through the UI if you plan on reusing the triggered send and the email template. Often times - setting up a few triggered sends in using the UI works in most cases.

Since your question is specifically about creating a triggered send with the API - here are the pieces you need.

1) Valid Email 2) Send Source - Triggered Send Data Extension created 3) Send Classification - this can be the default - but you will need the information from that in the initial step 4) Create, Start, Send Triggered Send - soap request bodies below.

Create Triggered Send Definition

<soapenv:Body>
  <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
     <Objects xsi:type="TriggeredSendDefinition">
        <PartnerKey xsi:nil="true"/>
        <ObjectID xsi:nil="true"/>
        <CustomerKey>ET_TriggeredSendDefinition</CustomerKey>
        <Name>Exacttarget TriggeredSend Definition demo 1</Name>
        <Description>Exacttarget TriggeredSend Definition demo desc</Description>
        <SendClassification>
           <PartnerKey xsi:nil="true"/>
           <CustomerKey>ET_SendClassification</CustomerKey>
           <ObjectID xsi:nil="true"/>
        </SendClassification>
        <Email>
           <PartnerKey xsi:nil="true"/>
           <ObjectID xsi:nil="true"/>
           <ID>8565</ID>
           <CustomerKey>ET_Email</CustomerKey>
        </Email>
        <!-- must use the data extension created with Triggered Send Template-->
        <SendSourceDataExtension>
           <CustomerKey>ET_DataExtension_TriggeredSend</CustomerKey>
        </SendSourceDataExtension>
        <TriggeredSendStatus>Active</TriggeredSendStatus>
     </Objects>
  </CreateRequest>

Setting TriggeredSendStatus to active should eliminate additional update calls - but if your sends don't work, you may have to perform an update to set that property to active.

Send the Triggered Send

   <soapenv:Body>
      <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <Objects xsi:type="TriggeredSend">
            <TriggeredSendDefinition>
               <CustomerKey>ET_TriggeredSend</CustomerKey>
            </TriggeredSendDefinition>
            <Subscribers>
               <EmailAddress>demo@exacttarget.com</EmailAddress>
               <SubscriberKey>ET_Subscriber_Key</SubscriberKey>
            </Subscribers>
         </Objects>
      </CreateRequest>
   </soapenv:Body>
Related Topic