API - getting subscribers in segment

Discussion in 'General discussions' started by eggerda, Feb 9, 2019.

  1. eggerda

    eggerda Member

    Joined:
    Feb 9, 2019
    Messages:
    32
    Likes Received:
    4
    S.E:
    2020-02-09 05:21:21
    L.T:
    Regular
    L.C:
    1
    Hello, brand new customer of MailWizz, and it's amazing what these guys have done. Excited to integrate into my business sending platform.

    Question: it's very important that we are able to use the API to GET specific subscribers from MailWizz that have been sent a certain autoresponder.

    My idea is to set a custom field once the autoresponder has been sent. And then create as segment for all of these subscribers that have this specific custom field set to a value?

    How can we use the API to GET just these subscribers? Let me know if this is possible. We will need to GET them and then unsubscribe them from MailWizz.

    Thanks, Dan
     
  2. ghimes

    ghimes Member Staff Member Support Staff

    Joined:
    Feb 2, 2018
    Messages:
    40
    Likes Received:
    12
  3. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,477
    Likes Received:
    2,444
    @eggerda - additionally to what @ghimes ( incepi sa te pricepi ) says, if you need to search by a specific custom field, we can add that functionality, just let us know.
     
  4. eggerda

    eggerda Member

    Joined:
    Feb 9, 2019
    Messages:
    32
    Likes Received:
    4
    S.E:
    2020-02-09 05:21:21
    L.T:
    Regular
    L.C:
    1
    Oh yes! That wold be amazing @twisted1919! Basically, we will create a custom field value when a certain autoresponder is SENT to a contact. Then our script will run and get ALL contacts in a certain list with THIS specific custom field value.

    Will that be easy functionality to add? That would be amazing! Let me know...

    P.S. I don't think getting the "segments" will work because I'd want it to return a list of all contacts in the segment, not the list of segments itself. If you could do the above for me, that would be amazing!
     
  5. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,477
    Likes Received:
    2,444
    @eggerda - i have added this in our dev and it will be available in the next release, here's how you will be able to use it:
    PHP:
    <?php

    // require the autoloader class
    require_once dirname(__FILE__) . '/../twisted1919-mailwizz-php-sdk/MailWizzApi/Autoloader.php';

    // register the autoloader.
    MailWizzApi_Autoloader::register();

    // configuration object
    $config = new MailWizzApi_Config(array(
        
    'apiUrl'        => 'http://mailwizz.test/api/index.php',
        
    'publicKey'     => 'xxx',
        
    'privateKey'    => 'yyy',
    ));

    // now inject the configuration and we are ready to make api calls
    MailWizzApi_Base::setConfig($config);

    // start UTC
    date_default_timezone_set('UTC');

    // CREATE THE ENDPOINT
    $endpoint = new MailWizzApi_Endpoint_ListSubscribers();

    // SEARCH BY custom field
    $response $endpoint->searchByCustomFields('sh296mj4sddc4', array(
        
    'FNAME' => 'the fname',
        
    'LNAME'  => ' the lname',
    ));

    // DISPLAY RESPONSE
    echo '<hr /><pre>';
    print_r($response->body);
    echo 
    '</pre>';
     
    frm.mwz likes this.
  6. eggerda

    eggerda Member

    Joined:
    Feb 9, 2019
    Messages:
    32
    Likes Received:
    4
    S.E:
    2020-02-09 05:21:21
    L.T:
    Regular
    L.C:
    1
    @twisted1919 thank you so much! Amazing support.

    2 quick questions:

    1. I assume this code will search ALL contacts on all lists? If so, if we've got, say 20,000 contacts, will it return results to our script fast?

    2. Will the results we get include all custom field values for each contact?

    Thank you!

    Dan
     
  7. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,477
    Likes Received:
    2,444
    @eggerda -
    1. The result is paginated of course, otherwise, returning 20k records will kill your server.
    2. Yes.
     
  8. eggerda

    eggerda Member

    Joined:
    Feb 9, 2019
    Messages:
    32
    Likes Received:
    4
    S.E:
    2020-02-09 05:21:21
    L.T:
    Regular
    L.C:
    1
    @twisted1919 Great! I think this will work... when will the next release come out so we can start using this? Thank you!
     
  9. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,477
    Likes Received:
    2,444
    @eggerda - we might have a maintenance release next week :)
     
  10. eggerda

    eggerda Member

    Joined:
    Feb 9, 2019
    Messages:
    32
    Likes Received:
    4
    S.E:
    2020-02-09 05:21:21
    L.T:
    Regular
    L.C:
    1
    @twisted1919 , that's great! How will I know when it's ready? Will my MailWizz tell me somewhere?
     
  11. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,477
    Likes Received:
    2,444
    Yup, you'll get a notification in your mailwizz dashboard ;)
     
  12. eggerda

    eggerda Member

    Joined:
    Feb 9, 2019
    Messages:
    32
    Likes Received:
    4
    S.E:
    2020-02-09 05:21:21
    L.T:
    Regular
    L.C:
    1
    @twisted1919 , just checking to make sure I didn't miss the release? I never got a notification on my dash...making sure I have that setting on as well. Let me know... thanks!
     
  13. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,477
    Likes Received:
    2,444
    @eggerda - sorry for the delay, we had some small issues and we delayed it. i will release these days for sure.
     
  14. eggerda

    eggerda Member

    Joined:
    Feb 9, 2019
    Messages:
    32
    Likes Received:
    4
    S.E:
    2020-02-09 05:21:21
    L.T:
    Regular
    L.C:
    1
    @twisted1919, no worries, thank you! We've still got more to do to be ready for go live with MailWizz.

    One more thing with this extension: List form custom redirect

    What would it take to enable that redirect for the "update profile" page? If someone accidentally subscribes again (or on purpose) instead of showing them this page, we just want to redirect them... let me know who I need to talk to... thank you!

    Dan
     
  15. laurentiu

    laurentiu Active Member Staff Member

    Joined:
    Mar 13, 2018
    Messages:
    319
    Likes Received:
    43
    @eggerda - Unfortunately, as far as i know, there is no way to do redirect in that page. instead, edit your email list and there is a field Sub. exists redirect to redirect people to some location when they try to register in a list and they already exist.
     
  16. eggerda

    eggerda Member

    Joined:
    Feb 9, 2019
    Messages:
    32
    Likes Received:
    4
    S.E:
    2020-02-09 05:21:21
    L.T:
    Regular
    L.C:
    1
    @laurentiu oh my gosh thank you! I can't believe I missed this! :)
     
  17. eggerda

    eggerda Member

    Joined:
    Feb 9, 2019
    Messages:
    32
    Likes Received:
    4
    S.E:
    2020-02-09 05:21:21
    L.T:
    Regular
    L.C:
    1
    @twisted1919 hello! Just a quick check to see when the next release is coming so we can test the new API call you've created for us above? Let us know... thank you! - Dan
     
  18. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,477
    Likes Received:
    2,444
    PM me and i'll get you the link :)
     
  19. majid1f

    majid1f Member

    Joined:
    Feb 23, 2015
    Messages:
    119
    Likes Received:
    22
    Can you send me too? Thanks
     
  20. gteindia

    gteindia Member

    Joined:
    Apr 28, 2018
    Messages:
    42
    Likes Received:
    2
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    @twisted1919 I need some help.

    I want to know whether it is possible for me to use the API to add subscriber to the selected MW list without going through the import routine. I want to use my standalone VBA code / Python script to directly add email addresses to the MW system.
     

Share This Page