0

I am able to use the following code to add user to multiple child BUs, but it possible to use SOAP call to disassociate a user from the parent Business Unit?

<soapenv:Envelope 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:par="http://exacttarget.com/wsdl/partnerAPI" >
    <soapenv:Header>
        <wsse:Security 
            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">
                <wsse:UsernameToken>
                    <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>  
   </soapenv:Header>
    <soapenv:Body>
        <par:UpdateRequest>
            <par:Options/>
            <par:Objects xsi:type="par:AccountUser">
           <par:Client>
               <par:ID>{{Parent_MID}}</par:ID>
            </par:Client>
            <par:UserID>{{userid}}</par:UserID>
            <par:DefaultBusinessUnit>{{Child_MID_1}}</par:DefaultBusinessUnit>
            <par:AssociatedBusinessUnits>
                <par:BusinessUnit>
                    <par:CustomerKey>{{Child_MID_1}}</par:CustomerKey>
                </par:BusinessUnit>
                 <par:BusinessUnit>
                    <par:CustomerKey>{{Child_MID_2}}</par:CustomerKey>
                </par:BusinessUnit>
                </par:AssociatedBusinessUnits>
         </par:Objects>
      </par:UpdateRequest>
    </soapenv:Body>
</soapenv:Envelope>

1 Answer 1

1

In your question where you have mentioned {{Parent_MID}} doesn't mean it should be a parent MID.

Imagine, you can create an user from any MID right? In the same way you just need to provide any MID for creating / updating the user.

The below SOAP helps me to update the user and the same can be used to create as well just change it to <par:CreateRequest>:

<soapenv:Envelope 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:par="http://exacttarget.com/wsdl/partnerAPI" >
    <soapenv:Header/>
    <soapenv:Body>
        <par:UpdateRequest>
            <par:Options/>
            <par:Objects xsi:type="par:AccountUser">            
            <par:Name>{{SOAPAPIUSER}}</par:Name>            
            <par:Email>{{email address}}</par:Email>
            <par:UserID>{{TestSOAPAPIUSER}}</par:UserID>        
            <par:Password>{{Sfmc@123}}</par:Password>
           <par:Client>
               <par:ID>{{Any MID}}</par:ID>
            </par:Client>
            <par:DefaultBusinessUnit>{{Default BU MID}}</par:DefaultBusinessUnit>
            <par:AssociatedBusinessUnits>
                <par:BusinessUnit>
                    <par:CustomerKey>{{associated BU MID}}</par:CustomerKey>
                </par:BusinessUnit>
                </par:AssociatedBusinessUnits>
         </par:Objects>
      </par:UpdateRequest>
    </soapenv:Body>
</soapenv:Envelope>

So, if the parent MID is not specified in the SOAP API calls, you can disassociate the user from parent MID.

Let me know if this helps.

5
  • Thanks for your reply. For some reason, we can't create account under the child BU in the UI. The same happened when I used the code you recommended above, and here is what I got <StatusCode>Error</StatusCode> <StatusMessage>Exception occurred during Create for AccountUser ErrorID: 593091929 The maximum number of account users has been reached for the account you are attempting to add or activate an account user to.</StatusMessage>
    – weliott
    Commented May 25, 2020 at 1:45
  • Hi @Eliott, this means that as per your contract you have reached maximum number of user license. You can either disable a user and create a new user. Or purchase few additional user license from your account executive. Let me know if this helps.
    – Naveen VM
    Commented May 25, 2020 at 2:09
  • I can add a user at parent level and assign child BUs to them in UI. I hope I can replicate that with SOAP. I also want to be able to disassociate the parent BU from existing users using SOAP. I can't do that in child BU level sadly.
    – weliott
    Commented May 25, 2020 at 2:40
  • Found solution salesforce.stackexchange.com/questions/28753/…
    – weliott
    Commented May 25, 2020 at 3:32
  • That's great ! @Eliott
    – Naveen VM
    Commented May 25, 2020 at 4:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .