1

I am using the following SOAP envelope for creating a marketing cloud user using SOAP API. I am testing it using POSTMAN, I got a status code 200, so the request went fine, but the user DID NOT get created on SFMC. Could anyone help to check what could be wrong?

Following is SOAP envelope which I am using. Using this the user did not get created in MC-

POST /Service.asmx HTTP/1.1
Host: webservice.s10.exacttarget.com
Content-Type: text/xml
SOAPAction: Create
Cache-Control: no-cache
Postman-Token: 23d086a6-6e7f-4c4e-8b7a-c374e440de6a

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Header>
      <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken wsu:Id="UsernameToken-24440876" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsse:Username>XXXXXXXXXX</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXXXXXXX</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
<createrequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
    <objects xsi:type="AccountUser">
        <partnerkey xsi:nil="true"></partnerkey>
        <objectid xsi:nil="true"></objectid>
        <client>
            <id>MID_of_the_BU</id>
        </client>
        <userid>TestAPIuser</userid>
        <password>test123456</password>
        <name>Test</name>
        <email>[email protected]</email>
        <activeflag>true</activeflag>
        <isapiuserspecified>true</isapiuserspecified>
        <isapiuser>true</isapiuser>
        <islockedspecified>true</islockedspecified>
        <islocked>true</islocked>
        <mustchangepassword>true</mustchangepassword>
        <mustchangepasswordspecified>true</mustchangepasswordspecified>            
         <defaultbusinessunit>MID_of_the_BU</defaultbusinessunit>
         <userpermissions>
            <useraccess>
                <id>3</id>
                 <idspecified>true</idspecified>
             </useraccess>
         </userpermissions>
        <ssoidentities>
            <ssoidentity>
                <isactive>true</isactive>
                <federatedid>TestAPIuser</federatedid>
            </ssoidentity>
        </ssoidentities>
    </objects>
</createrequest>
   </soapenv:Body>
</soapenv:Envelope>
1
  • can you post here what response you getting
    – Ravi.A
    Commented Jun 5, 2018 at 12:46

2 Answers 2

3

I was finally able to create a user and add roles as well with the help from support. Salesforce support mentioned that the API call that I used did not specify the roles which was the reason it was not working. So the following call worked for me:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<soapenv:Header> 
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> 
<wsse:UsernameToken wsu:Id="UsernameToken-32259181" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> 
<wsse:Username>ACCOUNT_USERNAME</wsse:Username> 
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"> 
ACCOUNT_PASSWORD
</wsse:Password> 
</wsse:UsernameToken> 
</wsse:Security> 
</soapenv:Header> 
<soapenv:Body> 
<CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
  <Options>
    <SaveOptions>
      <SaveOption>
        <PropertyName>*</PropertyName>
        <SaveAction>UpdateAdd</SaveAction>
      </SaveOption>
    </SaveOptions>
  </Options> 
  <Objects xsi:type="AccountUser">
    <PartnerKey xsi:nil="true"></PartnerKey>
    <ObjectID xsi:nil="true"></ObjectID>
    <Client>
      <ID>xxxx</ID>
    </Client>
    <UserID>SampleUser@1234</UserID>
    <Password>Password@1</Password>
    <Name>SampleUser@1234</Name>
    <Email>[email protected]</Email>
    <NotificationEmailAddress>[email protected]</NotificationEmailAddress>
    <ActiveFlag>true</ActiveFlag>
    <IsAPIUser>true</IsAPIUser>
    <IsLocked>false</IsLocked>
    <MustChangePassword>true</MustChangePassword>
    <DefaultBusinessUnit>xxxx</DefaultBusinessUnit>
    <Roles>
      <Role>
        <ObjectID>ROLE_ID_OF_THE_ROLES_IN_ACCOUNT</ObjectID>
      </Role>
    </Roles>
  </Objects>
</CreateRequest>
</soapenv:Body> 
</soapenv:Envelope>

The ROLE_ID_OF_THE_ROLES_IN_ACCOUNT can be found by adding the roles to a test user and query the 'AccountUser' object

1

The API call you are making may be asynchronous. So, the response you are seeing is that the API call was successfully queued, but not necessarily executed. See if you get a different response when you make a synchronous call?

To do this is postman, add a header for "Connection = Keep-Alive".

screenshot enter image description here

3
  • Hi @David Devoy, even though I was able to create a User & Assign roles as well, I am not able to set the SSO properties (isactive and federatedid) for a particular User account. Do you know how this can be done via a SOAP API envelope? Commented Jul 12, 2018 at 14:43
  • I would recommend posting a new question on stack exchange for this. It may be that those attributes are not retrievable via API. (not sure) Commented Jul 25, 2018 at 19:02
  • Finally, resolved it. The parameter names in the documentation was not correct. That was the reason. It should be - IsActive and FederatedID Commented Jul 27, 2018 at 13:19

You must log in to answer this question.

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