Page 1 of 1

Is there an API that works in 3.x?

PostPosted: 8:22am, Mon 03 Mar, 2014
by balidave
There was an API for PHPList originally developed by Ravi that worked in 2.x (see e.g. viewtopic.php?f=7&t=5009 )I've been using it for years - it allows you to create/delete/modify users and more. Has anyone had any experience trying to use this with 3.x? Or any other API developments that will now work?

Re: Is there an API that works in 3.x?

PostPosted: 1:54pm, Tue 04 Mar, 2014
by duncanc
This plugin https://github.com/EkAndreas/phplistapi works with phplist 3,although you will need to have a close look to see whether it includes all the functions that you need.

There are actually two plugins there, and the second one REST API Test, doesn't seem to work with phplist 3.

Re: Is there an API that works in 3.x?

PostPosted: 2:09pm, Tue 04 Mar, 2014
by duncanc
The Rest API Test plugin requires the curl extension to be installed in php, and will just fail if it is not.
You don't need the curl extension for the main plugin though.

Re: Is there an API that works in 3.x?

PostPosted: 8:24am, Thu 06 Mar, 2014
by balidave
Thanks duncanc, but I don't think (?) that solves my problem since I'm wanting to do things behind the scenes totally without the normal PHPList "doing its' thing", e.g. sending a confirmation email for a new subscription. Typically I need to silently add a subscriber (e.g. they made a purchase) IF that email doesn't exist, or modify the subscriber's attributes or update the email address.

I am not familiar with using REST but it appears I'd just issue commands to hit the PHPList pages used as if I were doing this from the admin interface. So I'd have to build structures to hit the appropriate pages for each of the operations I needed.

The old API I used, and I suspect it may still work tho perhaps with some bugs, just had addMember, modifyMember, deleteMember, .... (not the real names) member fns of the class object that was instantiated. I may have to just try this one but I was hoping someone had some experience with it or something equivalent.

Let me know if I'm missing something or there's another solution.

Re: Is there an API that works in 3.x?

PostPosted: 7:04pm, Sat 08 Mar, 2014
by jimlongo
I got the restapi_test to run as follows in phpList v3.

add the admin username and password to Config->Settings->develop settings->

then access . . .
Code: Select all
http://mydomain.com/list/admin/?page=main&pi=restapi_test


Although the author just stated on github, "The lib is open and free.
Just written for version 2 of phpList. No plans to upgrade."

Re: Is there an API that works in 3.x?

PostPosted: 5:47am, Sun 09 Mar, 2014
by balidave
@jimlongo: Thanks, but I don't think that helps me for what I need. I'm hoping someone got the old API I used before working with v3.