Loading

Configure SoapUI to run SOAP API Calls for Marketing Cloud

Veröffentlichungsdatum: Aug 30, 2023
Beschreibung

The Salesforce Marketing Cloud utilizes multiple APIs that can all be utilized to perform various actions. These APIs use separate WSDLs and Endpoints than the Sales and Service Cloud APIs.  

Let's get started with utilizing the most basic interface, SoapUI.

Lösung

Configure the SoapUI

1. Download SoapUI Open Source.
2. Paste the WSDL Link that corresponds to your Marketing Cloud Instance. The SOAP WSDL URL for your account can be located within your Marketing Cloud account by navigating to Setup > Settings > Company Settings > Account Settings.
3. Name your project.
4. Select File > New SOAP Project.
5. After installation completes, open SoapUI.

Once the WSDL populates the available Methods, you can expand any of the Methods, then open up the default 'Request 1' that's available, and begin working with the API.
 

Sample Triggered Send Request

This sample request the 'Create' method, so you will need to have Triggered Sends setup within your Marketing Cloud account. 

Note: In the SOAP UI:

  • Check the Endpoint in the top address bar.
  • Enter the SOAP Request (API Call) on the left half of the screen.
  • The SOAP Response will auto-populate on the right half of the screen.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Header>
      <wsse:Security soap:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-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>
   </soap:Header>
   <soap:Body>
      <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <Options/>
         <Objects xsi:type="TriggeredSend">
            <PartnerKey xsi:nil="true"/>
            <ObjectID xsi:nil="true"/>
            <TriggeredSendDefinition>
               <PartnerKey xsi:nil="true"/>
               <ObjectID xsi:nil="true"/>
               <CustomerKey>TRIGGERED SEND CUSTOMER KEY</CustomerKey>
            </TriggeredSendDefinition>
            <Subscribers>
               <PartnerKey xsi:nil="true"/>
               <ObjectID xsi:nil="true"/>
               <EmailAddress>RECIPIENT EMAIL ADDRESS</EmailAddress>
               <SubscriberKey>RECIPIENT SUBSCRIBER KEY</SubscriberKey>
               <Attributes>
                  <Name>First Name</Name>
                  <Value>Michelangelo</Value>
               </Attributes>
            </Subscribers>
         </Objects>
      </CreateRequest>
   </soap:Body>
</soap:Envelope>

If the steps above were completed correctly, testing with the Triggered Send call above should return a Response similar the sample below: 
<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>CreateResponse</wsa:Action>
      <wsa:MessageID>urn:uuid:b1a01b6b-55fa-4515-84e4-ba4a05ff3385</wsa:MessageID>
      <wsa:RelatesTo>urn:uuid:63a0cd4e-c30c-49eb-8bb5-df3abb16af37</wsa:RelatesTo>
      <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
      <wsse:Security>
         <wsu:Timestamp wsu:Id="Timestamp-2f5a6c0f-5df4-4326-8dc2-6a413595ba9f">
            <wsu:Created>2015-12-29T15:12:23Z</wsu:Created>
            <wsu:Expires>2015-12-29T15:17:23Z</wsu:Expires>
         </wsu:Timestamp>
      </wsse:Security>
   </soap:Header>
   <soap:Body>
      <CreateResponse xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <Results xsi:type="TriggeredSendCreateResult">
            <StatusCode>OK</StatusCode>
            <StatusMessage>Created TriggeredSend</StatusMessage>
            <OrdinalID>0</OrdinalID>
            <NewID>0</NewID>
         </Results>
         <RequestID>a5fa33dc-43f6-4428-af30-9dc9811dfab0</RequestID>
         <OverallStatus>OK</OverallStatus>
      </CreateResponse>
   </soap:Body>
</soap:Envelope>

This response, if successful, will include an OK and a Status Message indicating the results of the action performed. In this example, you will see 'Created TriggeredSend' noted. 

Important:
  • If you only receive an OK response and no status message, that indicates that the Marketing Cloud system didn't find any Syntax errors with the submitted call, but something required is missing, like a required Attribute. 
  • Passing a different value for a node of the API call is acceptable in some cases and provides developers with dynamic functionality without having to create a new Object or Definition. For example a new value for <FirstName> could be passed to use a 'FirstName' other than what is already held for the Subscriber. Or SendClassification details can be temporarily overwritten to perform a send using a different FromName, which is passed in the API call, than what is configured for the Triggered Send.
Note: The above example request uses username and password to authenticate the request. Alternatively, an access token can be retrieved from the API authentication service and passed in the SOAP envelope header. See the following documentation for more information on authenticating with an access token.


Getting help from Marketing Cloud Support

  • If you need help from Support regarding SOAP API Issues, Marketing Cloud Support will request the entire SOAP Envelope in order to replicate the issue. This SOAP Envelope should include both the submitted Request, as well as the response received from the Marketing Cloud System.
  • If you use a PHP, .NET, or Java platform, the SOAP Envelope can be retrieved when requested by Support.
Nummer des Knowledge-Artikels

000387885

 
Laden
Salesforce Help | Article