Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8034267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:57:29+00:00 2026-06-05T01:57:29+00:00

I’m planning to create lists and add user details as subscribers to them using

  • 0

I’m planning to create lists and add user details as subscribers to them using the exacttarget SOAP API in PHP. The code api has sample code on creating a list. I built my custom logic based on it as follows

public function createList($siteId, $siteDescription){
        try {
            $list = new ExactTarget_List();
            // $list->Description = "PHP Created List"; // List for the venue
            // $list->ListName = "PHP API Created List"; // Description about the list
            $list->Description = $siteDescription; // List for the venue
            $list->ListName = $siteId;
            $object = new SoapVar($list, SOAP_ENC_OBJECT, 'List', "http://exacttarget.com/wsdl/partnerAPI");
            $request = new ExactTarget_CreateRequest();
            $request->Options = NULL;
            $request->Objects = array($object);
            $results = $client->Create($request);
            if ($results->OverallStatus == 'OK') 
            {
                echo 'SUCCESS';
            }
            else
            {
            echo 'FAILED';
            }    
        }
        catch (SoapFault $e) {
            // var_dump(e);
            $this->success = 0;
        }
    }

But my workflow is such that in case list already exists I should proceed to next step of adding subscribers (doh!) to it else create the list first and add subscribers. I could not find any example code snippet on checking if the list exists or not using the code API doc and hence am wondering if this is possible at all. My meager understanding of SOAP and XML is playing big time here and hence requesting if any veterans who have better knowledge or idea on this share some details on it to aid my cause.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:57:30+00:00Added an answer on June 5, 2026 at 1:57 am

    You can grab all lists fairly easily – for instance, follow the code from the following ET technical doc:
    http://docs.code.exacttarget.com/020_Web_Service_Guide/Technical_Articles/Retrieving_a_List_from_an_Account

    The article is fairly good (relatively speaking, of course), and I can vouch for its accuracy. Here’s the pertinent bit from the PHP section:

        $rr = new ExactTarget_RetrieveRequest();
        $rr->ObjectType = "List";   
        $rr->Properties =  array();
        $rr->Properties[] = "ID";
        $rr->Properties[] = "List.ListName";        
        $rr->Options = NULL;
    
        $rrm = new ExactTarget_RetrieveRequestMsg();
        $rrm->RetrieveRequest = $rr;        
    
        $results = $client->Retrieve($rrm);  
            var_dump($results);
    

    To grab a specific list, you create a SimpleFilterPart object and attach it to your RetrieveRequest (note – this part is buggy, untested, terrible PHP code – I wrote it in Python and then translated it here – if you really really need help with this part, message me):

        $sfp=new ExactTarget_SimpleFilterPart;
        $sfp=>Property = "ListID";
        $sfp=>SimpleOperator = new ExactTarget_SimpleOperators->equals;
        $sfp=>Value = Array(contact_list);
        $retrieverequest=>Filter = $sfp;
    

    Hope that saves some headache for someone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm trying to create an if statement in PHP that prevents a single post
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.