2

I am creating a Data Extension on Marketing cloud via SOAP API and it works without issue. The data extension creates on root folder. But I need to create the same on a sub folder. (Data Extensions/Test/Samples)

Here is my code.

<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>
            <wsse:Username>xxxx</wsse:Username>
            <wsse:Password>xxxx</wsse:Password>
        </wsse:UsernameToken>
    </wsse:Security>
</soap:Header>
<soap:Body>
    <CreateRequest
        xmlns="http://exacttarget.com/wsdl/partnerAPI">
        <Options>
            <SaveOptions/>
        </Options>
        <Objects xsi:type="DataExtension">
            <Client>
                <ID>7317455</ID>
            </Client>
            <PartnerKey xsi:nil="true" />
            <ObjectID xsi:nil="false" />
            <Name>TEST_DE_2</Name>
            <Description>MKT_POC_DE_1</Description>
            <IsSendable>false</IsSendable>
            <IsTestable>false</IsTestable>
            <DataRetentionPeriodLength>48</DataRetentionPeriodLength>
            <DataRetentionPeriod>Days</DataRetentionPeriod>
            <RowBasedRetention>false</RowBasedRetention>
            <ResetRetentionPeriodOnImport>true</ResetRetentionPeriodOnImport>
            <DeleteAtEndOfRetentionPeriod>false</DeleteAtEndOfRetentionPeriod>
            <Fields>
                <Field>
                    <CustomerKey>F1_ID</CustomerKey>
                    <Name>F1_ID</Name>
                    <Description>F1_ID</Description>
                    <IsPrimaryKey>true</IsPrimaryKey>
                    <MaxLength>100</MaxLength>
                    <FieldType>Text</FieldType>
                    <DefaultValue></DefaultValue>
                    <IsRequired>true</IsRequired>
                </Field>
                <Field>
                    <Name>F2_Email</Name>
                    <Description>F2_Email</Description>
                    <IsNillable>false</IsNillable>
                    <IsPrimaryKey>false</IsPrimaryKey>
                    <FieldType>EmailAddress</FieldType>
                    <DefaultValue></DefaultValue>
                </Field>
                <Field>
                    <CustomerKey>F3_Date</CustomerKey>
                    <Name>F3_Date</Name>
                    <DataType>Date</DataType>
                    <Label>F3_Date</Label>
                    <IsNillable>true</IsNillable>
                    <IsPrimaryKey>false</IsPrimaryKey>
                    <FieldType>Date</FieldType>
                    <DefaultValue>getdate()</DefaultValue>
                </Field>
                <Field>
                    <CustomerKey>F4_Decimal</CustomerKey>
                    <Name>F4_Decimal</Name>
                    <FieldType>Decimal</FieldType>
                    <IsRequired>true</IsRequired>
                    <Precision>10</Precision>
                    <Scale>2</Scale>
                </Field>
                <Field>
                    <Name>F5_Boolean</Name>
                    <FieldType>Boolean</FieldType>
                    <DefaultValue>true</DefaultValue>
                    <IsRequired>true</IsRequired>
                </Field>
                <Field>
                    <Name>F6_Phone</Name>
                    <FieldType>Phone</FieldType>
                    <IsRequired>false</IsRequired>
                </Field>
            </Fields>
        </Objects>
    </CreateRequest>
</soap:Body>

Any Idea?

3

You need to pass Folder ID as CategoryID - https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/dataextension.htm

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.