2

I'm trying to add a record to an existing Data Extension using the SOAP API. I'm using the cURL command:

 curl -XPOST -H "Content-type: text/xml; charset=utf-8" -H "SOAPAction: Update" -d @create.xml https://webservice.test.exacttarget.com/Service.asmx

And the SOAP request envelope:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/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">
    <soap:Header>
        <wsse:Security soap:mustUnderstand="1">
            <wsse:UsernameToken wsu:Id="SecurityToken-6421ac0b-a454-42a3-99f7-a77ace024446">
                <wsse:Username>username</wsse:Username>
                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
            </wsse:UsernameToken>
        </wsse:Security>
    </soap:Header>
    <soap:Body>
        <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
            <Options/>
            <Objects xsi:type="DataExtensionObject">
                <CustomerKey>0505A0A4-88AB-4FCA-AAC5-4873CD3C069B</CustomerKey>
                <Properties>
                    <Property>
                        <Name>CustomerID</Name>
                        <Value>9999</Value>
                    </Property>
                    <Property>
                        <Name>FirstName</Name>
                        <Value>Sandra</Value>
                    </Property>
                    <Property>
                        <Name>LastName</Name>
                        <Value>Sample</Value>
                    </Property>
                    <Property>
                        <Name>City</Name>
                        <Value>Melbourne</Value>
                    </Property>
                    <Property>
                        <Name>ID</Name>
                        <Value>9999</Value>
                    </Property>
                </Properties>
            </Objects>
        </CreateRequest>
    </soap:Body>
</soap:Envelope>

The odd thing is that this request returns a successful response:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/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">
    <soap:Header>
        <wsa:Action>UpdateResponse</wsa:Action>
        <wsa:MessageID>urn:uuid:faa0e314-c3b0-4bf9-b0ec-6264b3451363</wsa:MessageID>
        <wsa:RelatesTo>urn:uuid:e7e6a13e-aec1-4088-9fe2-fd183b399e6f</wsa:RelatesTo>
        <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
        <wsse:Security>
            <wsu:Timestamp wsu:Id="Timestamp-fc8b23da-b6ef-4599-8e3a-5c1257bd5984">
                <wsu:Created>2014-02-02T08:30:39Z</wsu:Created>
                <wsu:Expires>2014-02-02T08:35:39Z</wsu:Expires>
            </wsu:Timestamp>
        </wsse:Security>
    </soap:Header>
    <soap:Body>
        <UpdateResponse xmlns="http://exacttarget.com/wsdl/partnerAPI">
            <RequestID>da073ac2-56e8-4bbb-9749-3b825ec271e5</RequestID>
            <OverallStatus>OK</OverallStatus>
        </UpdateResponse>
    </soap:Body>
</soap:Envelope>

However when I login to Marketing Cloud (on the sandbox https://mc.test.exacttarget.com) this new record does not appear in the Data Extension. Can anyone explain why?

0

Use SOAPAction: Create instead of SOAPAction: Update in curl request.

  • Yes, I assumed that I should use "SOAPAction: Create" to begin with, but it returns an error. You can view the error response envelope here. – Eliot Harper Feb 2 '14 at 20:09
  • It appears that it's working in production (s6) endpoint (using Create SOAPAction) but not with sandbox endpoint webservice.test.exacttarget.com/Service.asmx. Can someone confirm this is a bug? – Eliot Harper Feb 3 '14 at 8:13
  • The error code produced indicates The search_value2 does not contain a valid email address. Does your data extension contain an email field at all? Is the test and s6 data extensions identical? Seems like an odd error based on the data. – Kelly J Andrews Feb 3 '14 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.