0

I'm having trouble creating an API call that will create a Data Extension. I'm referring to the docs located here.

Using this request:

curl -v -X POST -H "Content-Type: text/xml" -H "SOAPAction: Retrieve" -d "$(cat xmlrequest.txt)" "https://webservice.s6.exacttarget.com/Service.asmx"

Where the contents of xmlrequestl.txt are:

<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Header>
    <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <UsernameToken>
        <Username>jared@lytics.io</Username>
        <Password>#OUR_VALID_PASSWORD#</Password>
      </UsernameToken>
    </Security>
  </Header>
  <Body>
    <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
    <Options></Options>
    <Objects xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI" xsi:type="ns1:DataExtension">
        <CustomerKey>TestDataExtensionFromAPI</CustomerKey>
        <Name>TestDataExtensionFromAPI</Name>
        <IsSendable>true</IsSendable>
        <SendableDataExtensionField>
            <CustomerKey>EmailAddress_Key</CustomerKey>
            <Name>EmailAddress</Name>
            <FieldType>EmailAddress</FieldType>
        </SendableDataExtensionField>
        <SendableSubscriberField>
            <Name>Email Address</Name>
            <Value></Value>
        </SendableSubscriberField>
        <Fields>
            <Field>
                <CustomerKey>EmailAddress_Key</CustomerKey>
                <Name>EmailAddress</Name>
                <FieldType>EmailAddress</FieldType>
            </Field>
            <Field>
                <CustomerKey>ChannelUser_Key</CustomerKey>
                <Name>ChannelUser</Name>
                <FieldType>Text</FieldType>
            </Field>
            <Field>
                <CustomerKey>ChannelUser_EmailAddress_Key</CustomerKey>
                <Name>ChannelUser_EmailAddress</Name>
                <FieldType>EmailAddress</FieldType>
            </Field>
            <Field>
                <CustomerKey>Demographic_Address_Key</CustomerKey>
                <Name>Demographic_Address</Name>
                <FieldType>Text</FieldType>
            </Field>
        </Fields>
    </Objects>
</CreateRequest>

When I do this, I receive a 100 Continue paired with a 200 OK, but the body of the response indicates a problem:

<OverallStatus>Error</OverallStatus>
<RequestID>1faa970c-3296-4ec9-8e2c-3e56619f9d42</RequestID>

How can I correct my request?

Thank you!

2

Right after I posted this, I realized the problem was that I was using a SOAPAction of Retrieve, rather than Create. Fixing this resolved the issue.

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.