0

I'm working in Postman with various SOAP API calls.

I'm new to using 'UpdateRequest'. I've been able to update data in rows of a data extension, but not the properties of a data extension, such as category id.

My goals are to move existing data extensions to new folders by changing the category ids via a soap call and to learn more about UpdateRequest.

Example of a call I tried (not working - the category id does not update):

<?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:MessageID>urn:uuid:1234-1234-1234-1234-1432</a:MessageID>
        <a:ReplyTo>
            <a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>
        </a:ReplyTo>
        <a:To s:mustUnderstand="1">{{soapEndPoint}}/Service.asmx</a:To>
        <fueloauth xmlns="http://exacttarget.com">{{accessToken}}</fueloauth>
    </s:Header>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <UpdateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
            <Objects xsi:type="DataExtension">
                <PartnerKey xsi:nil="true"></PartnerKey>
                <ModifiedDate xsi:nil="true"></ModifiedDate>
                <ObjectID xsi:nil="true"></ObjectID>
                <CustomerKey>12345-12345678</CustomerKey>
                <Properties>
                    <Property>
                        <Name>CategoryID</Name>
                        <Value>123456</Value>
                    </Property>
                </Properties>
            </Objects>
        </UpdateRequest>
    </s:Body>
</s:Envelope>

The response (says 'Data Extension updated.', but the category id is not updated)

<soap:Body>
    <UpdateResponse xmlns="http://exacttarget.com/wsdl/partnerAPI">
        <Results>
            <StatusCode>OK</StatusCode>
            <StatusMessage>Data Extension updated.</StatusMessage>
            <OrdinalID>0</OrdinalID>
            <Object xsi:type="DataExtension">
                <PartnerKey xsi:nil="true" />
                <ModifiedDate xsi:nil="true" />
                <ObjectID>799d2d6b-495e-eb11-a2f8-123123123</ObjectID>
                <CustomerKey>123456-5432-4e87-123-d2f4713e449b</CustomerKey>
            </Object>
        </Results>
        <RequestID>213456-99dd-3456-3456-3456346346</RequestID>
        <OverallStatus>OK</OverallStatus>
    </UpdateResponse>
</soap:Body>
1

The CategoryID doesn't need to be nested inside properties tags. Below is an example that works in my environment. I usually just pass the External Key and CategoryID (Folder ID) but you can add additional fields you need. Note: you'll likely need to change the {{et_subdomain}} and {{dne_etAccessToken}} variables used in my Postman collection.

There are a variety of sample calls in a collection my team manages here: https://api.mcexperts.ninja/. This specific call isn't in there but a similar update example is. The collection has almost all the REST routes but SOAP still needs to be more thoroughly built out. Hope this helps!

<?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">Update</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">
    <UpdateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
        <Options /> 
        <Objects xsi:type="ns1:DataExtension" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI">
            <CustomerKey>5259588A-29E0-446E-ACD4-17D7F8490933</CustomerKey> 
            <CategoryID>1691183</CategoryID>
        </Objects>
    </UpdateRequest>
</s:Body>
</s:Envelope>
1

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.