2

is there a way to remove a Role from a user using the Marketing Cloud SOAP API? I've retrieved the AccountUser object with the corresponding Roles, I remove the specific Role from the array and make an Update to that user and it's Roles. I get a successful response from the API but when I go check in Marketing Cloud the user still has the role I was trying to remove.

Any insights or past experience is greatly appreciated. Thanks!

  • Can you share teh soap enevelope you are using to update the accountuser object? – EazyE Dec 5 '19 at 20:16
0

Use following soap request to remove role at business unit level:

<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>Configure</wsa:Action>
    <wsa:MessageID>urn:uuid:1f56f49d-3edf-4782-99ff-9889d9b88a4a</wsa:MessageID>
    <wsa:ReplyTo>
        <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
    </wsa:ReplyTo>
    <wsa:To>https://webservice.{{stack}}.exacttarget.com/Service.asmx</wsa:To>
    <fueloauth>[ACCESS_TOKEN]</fueloauth>
</soap:Header>
<soap:Body>
    <ConfigureRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
            <Action>assign</Action>
            <Configurations>
              <Configuration xsi:type="Role">
                   <!--*****ROLE ID*****-->
                   <ObjectID>[ROLE_ID]</ObjectID>
                         <AssignmentConfigurations>
                             <AssignmentConfiguration>
                                <AccountUserId>[USER_ID]</AccountUserId>
                                <BusinessUnitId>[MID_HERE]</BusinessUnitId>
                                <AssignmentConfigureType>RoleUserBusinessUnit</AssignmentConfigureType>
                                <!--TO DELETE ROLE FROM USER AT BUSINESSUNIT MARK TRUE -->
                                <IsDelete>true</IsDelete>
                             </AssignmentConfiguration>
                          </AssignmentConfigurations>
            </Configuration>
        </Configurations>
    </ConfigureRequestMsg>
</soap:Body>

  • Thank you! When I perform that request I get: <OverallStatus>OK</OverallStatus> But the change is not reflected in the UI. – patosapir Dec 6 '19 at 21:59
  • @patosapir this request is for removing roles assigned at Business Unit level and not directly assigned to the user. Please check how role was assigned. – Ros Haitovich Dec 7 '19 at 8:24
0

I've actually was able to do this based on the previous response provided, here's the SOAP body:

<soap:Body>
        <UpdateRequest
            xmlns="http://exacttarget.com/wsdl/partnerAPI">
            <Objects xsi:type="AccountUser">
                <Client>
                    <ID>[[MID]]</ID>
                </Client>
                <UserID>psapirasdasd.devsutd</UserID>
                <Roles>
                    <Role>
                        <ObjectID>[[Role.ObjectID]]</ObjectID>
                        <AssignmentConfigurations>
                            <AssignmentConfiguration>
                                <AccountUserId>[[User.ID]]</AccountUserId>
                                <AssignmentConfigureType>RoleUser</AssignmentConfigureType>
                                <IsDelete>true</IsDelete>
                            </AssignmentConfiguration>
                        </AssignmentConfigurations>
                    </Role>
                </Roles>
            </Objects>
        </UpdateRequest>
    </soap:Body>

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.