Unable to load listSubscribe()!

422 views
Skip to first unread message

Guillaume

unread,
Sep 3, 2010, 6:14:13 AM9/3/10
to MailChimp API Discuss
Hi there,
I try to figure out what problem there is in my settings.
Everything seems to work but sometimes I get an error message like
this:
------------------
Unable to load listSubscribe()!
Code=-90
Msg=You must specify a apikey value for the listSubscribe method
-------------------
Sometimes for duplicate:
-------------------
Unable to load listSubscribe()!
Code=214
Msg={email address here} is already subscribed to list {list name
here}
------------------

I did few tests and I receive the email with a confirmation link.

What is wrong with some users and the errors above?

Regards,
Guillaume.

jesse

unread,
Sep 3, 2010, 9:54:35 AM9/3/10
to MailChimp API Discuss
The errors are pretty self-explanatory:

-90 - somehow you managed to not set/pass the apikey parameter. Make
sure that never happens and the error message goes away.

214 - the email address is already subscribed to the list. If you need
to test the full subscribe process on the same email address,
unsubscribe it first. If you are trying to update them, set the
update_existing parameter.


jesse

Guillaume

unread,
Sep 3, 2010, 3:23:54 PM9/3/10
to MailChimp API Discuss
I agree, but I use your API class and it works for some of the users.
Question:
why, if the process is exactly the same, it works for some users and
not for other one? (I am talking about the error -90, not error 214
this one is clear)
Guillaume.

jesse

unread,
Sep 3, 2010, 4:03:59 PM9/3/10
to MailChimp API Discuss
The email addresses you are passing almost certainly have nothing to
do with what's going on. Are you using a current copy of the PHP
wrapper? Somehow you are wiping out the api key that's been saved in
the class when it was instantiated. Once you figure out where in your
code that is happening, you should be able to stop those.


jesse

Rod

unread,
Oct 11, 2010, 5:17:46 PM10/11/10
to MailChimp API Discuss
Hi,

If I could "chime in" on this one... since I'm having the same issue.
and I'll apologize up front - I'm definitely NOT an api guru...

Question: does the email address need to be in the config.inc.php?
If so - how then do you set it based on the field in a form? I'm
building a form with a bunch of javascript that shows fields based on
radio buttons that have been clicked. The email field is in the form
and I've been trying to post it to API this way:

$my_email = $_POST[text_1];
$fname = $_POST[text_2];
echo $email .'/' .$fname .'/' .$interest;
$interest = $_POST[radio0];
echo $interest;

require_once 'inc/MCAPI.class.php';
require_once 'inc/config.inc.php'; //contains apikey

$api = new MCAPI($apikey);
$merge_vars = array('FNAME'=>$fname, 'LNAME'=>'', 'INTERESTS'=>
$interest);
$retval = $api->listSubscribe( $listId, $my_email, $merge_vars );

if ($api->errorCode){
echo "Unable to load listSubscribe()!\n";
echo "\tCode=".$api->errorCode."\n";
echo "\tMsg=".$api->errorMessage."\n";
} else {
echo "Returned: ".$retval."\n";
}

I've tried putting the following in the inc.php file - but of course -
it doesn't work...

$my_email = $_POST[text1];


any help would be appreciated...
thanks!

jesse

unread,
Oct 11, 2010, 5:27:42 PM10/11/10
to MailChimp API Discuss
The config.inc.php file is not really necessary - it's just there to
let people setup a few test values and easily run through various API
methods.

You are correct that what ever is being passed to listSubscribe() as
the "email_address" parameter needs to be the email. If that's your
actual code, I'd imagine that text_1 and text1 are not actual
constants and thus are blank values - that's just basic PHP stuff
you'll need to get used to, though.



jesse

On Oct 11, 5:17 pm, Rod <rodsdes...@gmail.com> wrote:
> Hi,
>
> If I could "chime in" on this one... since I'm having the same issue.
> and I'll apologize up front - I'm definitely NOT an api guru...
>
> Question:  does the email address need to be in the config.inc.php?
> If so - how then do you set it based on the field in a form?  I'm
> building a form with a bunch of javascript that shows fields based on
> radio buttons that have been clicked.  The email field is in the form
> and I've been trying to post it to API this way:
>
> $my_email = $_POST[text_1];
> $fname = $_POST[text_2];
> echo $email .'/' .$fname .'/' .$interest;
> $interest = $_POST[radio0];
> echo $interest;
>
> require_once 'inc/MCAPI.class.php';
> require_once 'inc/config.inc.php'; //contains apikey
>
> $api = new MCAPI($apikey);
> $merge_vars = array('FNAME'=>$fname, 'LNAME'=>'', 'INTERESTS'=>
> $interest);
> $retval = $api->listSubscribe( $listId, $my_email, $merge_vars );
>
> if ($api->errorCode){
> echo "UnabletoloadlistSubscribe()!\n";

Rod

unread,
Oct 12, 2010, 8:53:40 AM10/12/10
to MailChimp API Discuss
as usually happens... about an hour later - I got it working.

I removed the apostraphes in the line that sets up the array. (the
values were being passed correctly - just not being put into the
array.)
so - the above worked...

I do get your point about the config.inc.php - and of course - that
makes total sense.

I was trying to do this on a Joomla site using Chronoforms. I *think*
Chronoforms didn't like the: $merge_vars = array('FNAME'=>$fname,
'LNAME'=>'', 'INTERESTS'=>$interest);
When I made it $merge_vars = array(FNAME=>$fname, LNAME=>'',
INTERESTS=>$interest); it worked...

I will say that the error checking in Chronoforms/Joomla was what
helped me figure it out - so I'm not too frustrated lol...

thanks for your reply Jesse... I LOVE MailChimp - have recommended it
so many times I've lost track :)

Rod
Reply all
Reply to author
Forward
0 new messages