Example SOAP API Call - listOperation

Version 2

    Note: Please ensure that you have access to an experienced Web developer. Marketo Technical Support is not set up to assist with troubleshooting code.

    The listOperation SOAP API call allows for the ability to interact with static lists (My Lists) in the Lead Database. The supported operations are adding a lead to list (ADDTOLIST), checking if a lead is a member of the list (ISMEMBEROFLIST), and removing a lead from a list (REMOVEFROMLIST)


    Note, there is no operation to create a new list (or delete) via the SOAP API. The list must be created beforehand in the Lead Database. In the examples, the list is named "Static List".

    Example 1 - Request: Adding multiple leads into the list

    <soapenv:Envelope xmlns:soapenv = "http://schemas.xmlsoap.org/soap/envelope/" xmlns:mkt = "http://www.marketo.com/mktows/">

        <soapenv:Header>

            <mkt:AuthenticationHeader>

     

             <mktowsUserId>[User Id]</mktowsUserId>

     

             <requestSignature>[Signature]</requestSignature>

             <requestTimestamp>[yyyy-mm-ddThh:mm:ss-00:00]</requestTimestamp>

            </mkt:AuthenticationHeader>

        </soapenv:Header>

        <soapenv:Body>

            <mkt:paramsListOperation>

                <listOperation>ADDTOLIST</listOperation>

                <listKey>

                    <keyType>MKTOLISTNAME</keyType>

                    <keyValue>Static List</keyValue>

                </listKey>

                <listMemberList>

                    <leadKey>

                        <keyType>IDNUM</keyType>

                        <keyValue>213</keyValue>

                    </leadKey>

                    <leadKey>

                        <keyType>IDNUM</keyType>

                        <keyValue>215</keyValue>

                    </leadKey>

                </listMemberList>

            </mkt:paramsListOperation>

        </soapenv:Body>

    </soapenv:Envelope>

     

    Example 1 - Response:

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://www.marketo.com/mktows/">

       <SOAP-ENV:Body>

          <ns1:successListOperation>

             <result>

                <success>true</success>

                <statusList xsi:nil="true"/>

             </result>

          </ns1:successListOperation>

       </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>

     

    Example 2 - Request: Check to see if leads are a part of list. One lead (Lead ID #213) is and the other (Lead ID #70) is not 

    <soapenv:Envelope xmlns:soapenv = "http://schemas.xmlsoap.org/soap/envelope/" xmlns:mkt = "http://www.marketo.com/mktows/">

     

        <soapenv:Header>

     

            <mkt:AuthenticationHeader>

     

     

             <mktowsUserId>[User Id]</mktowsUserId>

     

             <requestSignature>[Signature]</requestSignature>

             <requestTimestamp>[yyyy-mm-ddThh:mm:ss-00:00]</requestTimestamp>

            </mkt:AuthenticationHeader>

        </soapenv:Header>

        <soapenv:Body>

            <mkt:paramsListOperation>

                <listOperation>ISMEMBEROFLIST</listOperation>

                <listKey>

                    <keyType>MKTOLISTNAME</keyType>

                    <keyValue>Static List</keyValue>

                </listKey>

                <listMemberList>

                    <leadKey>

                        <keyType>IDNUM</keyType>

                        <keyValue>213</keyValue>

                    </leadKey>

                    <leadKey>

                        <keyType>IDNUM</keyType>

                        <keyValue>70</keyValue>

                    </leadKey>

                </listMemberList>

            </mkt:paramsListOperation>

        </soapenv:Body>

    </soapenv:Envelope>

     

    Example 2 - Response:

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.marketo.com/mktows/">

       <SOAP-ENV:Body>

          <ns1:successListOperation>

             <result>

                <success>false</success>

                <statusList>

                   <leadStatus>

                      <leadKey>

                         <keyType>IDNUM</keyType>

                         <keyValue>213</keyValue>

                      </leadKey>

                      <status>true</status>

                   </leadStatus>

                   <leadStatus>

                      <leadKey>

                         <keyType>IDNUM</keyType>

                         <keyValue>70</keyValue>

                      </leadKey>

                      <status>false</status>

                   </leadStatus>

                </statusList>

             </result>

          </ns1:successListOperation>

       </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>

     

    Example 3 - Request: Similar to Example 2, but all leads are valid 

    <soapenv:Envelope xmlns:soapenv = "http://schemas.xmlsoap.org/soap/envelope/" xmlns:mkt = "http://www.marketo.com/mktows/">

     

        <soapenv:Header>

     

            <mkt:AuthenticationHeader>

     

     

             <mktowsUserId>[User Id]</mktowsUserId>

     

             <requestSignature>[Signature]</requestSignature>

             <requestTimestamp>[yyyy-mm-ddThh:mm:ss-00:00]</requestTimestamp>

            </mkt:AuthenticationHeader>

        </soapenv:Header>

        <soapenv:Body>

            <mkt:paramsListOperation>

                <listOperation>ISMEMBEROFLIST</listOperation>

                <listKey>

                    <keyType>MKTOLISTNAME</keyType>

                    <keyValue>Static List</keyValue>

                </listKey>

                <listMemberList>

                    <leadKey>

                        <keyType>IDNUM</keyType>

                        <keyValue>213</keyValue>

                    </leadKey>

                    <leadKey>

                        <keyType>IDNUM</keyType>

                        <keyValue>215</keyValue>

                    </leadKey>

                </listMemberList>

            </mkt:paramsListOperation>

        </soapenv:Body>

    </soapenv:Envelope>


    Example 3 - Response: 

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://www.marketo.com/mktows/">

     

       <SOAP-ENV:Body>

          <ns1:successListOperation>

             <result>

                <success>true</success>

                <statusList xsi:nil="true"/>

             </result>

          </ns1:successListOperation>

       </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>


    Example 4 - Request: Remove leads from the list. One lead (Lead ID #213) is a member of the list, the other (Lead ID #70) is not 

    <soapenv:Envelope xmlns:soapenv = "http://schemas.xmlsoap.org/soap/envelope/" xmlns:mkt = "http://www.marketo.com/mktows/">

        <soapenv:Header>

     

            <mkt:AuthenticationHeader>

     

     

             <mktowsUserId>[User Id]</mktowsUserId>

     

             <requestSignature>[Signature]</requestSignature>

             <requestTimestamp>[yyyy-mm-ddThh:mm:ss-00:00]</requestTimestamp>

            </mkt:AuthenticationHeader>

        </soapenv:Header>

        <soapenv:Body>

            <mkt:paramsListOperation>

                <listOperation>REMOVEFROMLIST</listOperation>

                <listKey>

                    <keyType>MKTOLISTNAME</keyType>

                    <keyValue>Static List</keyValue>

                </listKey>

                <listMemberList>

                    <leadKey>

                        <keyType>IDNUM</keyType>

                        <keyValue>213</keyValue>

                    </leadKey>

                    <leadKey>

                        <keyType>IDNUM</keyType>

                        <keyValue>70</keyValue>

                    </leadKey>

                </listMemberList>

            </mkt:paramsListOperation>

        </soapenv:Body>

    </soapenv:Envelope>


    Request 4 - Response: 

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.marketo.com/mktows/">

     

       <SOAP-ENV:Body>

          <ns1:successListOperation>

             <result>

                <success>false</success>

                <statusList>

                   <leadStatus>

                      <leadKey>

                         <keyType>IDNUM</keyType>

                         <keyValue>213</keyValue>

                      </leadKey>

                      <status>true</status>

                   </leadStatus>

                   <leadStatus>

                      <leadKey>

                         <keyType>IDNUM</keyType>

                         <keyValue>70</keyValue>

                      </leadKey>

                      <status>false</status>

                   </leadStatus>

                </statusList>

             </result>

          </ns1:successListOperation>

       </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>

    Example 5 - Request: Similar to Example 4, but all leads are valid 

    <soapenv:Envelope xmlns:soapenv = "http://schemas.xmlsoap.org/soap/envelope/" xmlns:mkt = "http://www.marketo.com/mktows/">

        <soapenv:Header>

     

            <mkt:AuthenticationHeader>

     

     

             <mktowsUserId>[User Id]</mktowsUserId>

     

             <requestSignature>[Signature]</requestSignature>

             <requestTimestamp>[yyyy-mm-ddThh:mm:ss-00:00]</requestTimestamp>

            </mkt:AuthenticationHeader>

        </soapenv:Header>

        <soapenv:Body>

            <mkt:paramsListOperation>

                <listOperation>REMOVEFROMLIST</listOperation>

                <listKey>

                    <keyType>MKTOLISTNAME</keyType>

                    <keyValue>Static List</keyValue>

                </listKey>

                <listMemberList>

                    <leadKey>

                        <keyType>IDNUM</keyType>

                        <keyValue>213</keyValue>

                    </leadKey>

                    <leadKey>

                        <keyType>IDNUM</keyType>

                        <keyValue>215</keyValue>

                    </leadKey>

                </listMemberList>

            </mkt:paramsListOperation>

        </soapenv:Body>

    </soapenv:Envelope>


    Example 5 - Response: 

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://www.marketo.com/mktows/">

     

       <SOAP-ENV:Body>

          <ns1:successListOperation>

             <result>

                <success>true</success>

                <statusList xsi:nil="true"/>

             </result>

          </ns1:successListOperation>

       </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>

     

    Related Learning Resources