cant get the subscriber.add to work

hi all

very new to this so go easy :)

i am simply trying to use the api with PHP and SOAP (nuSOAP) - but am having some problems...

here is my code - any ideas?

require_once('nuSOAP/lib/nusoap.php');

$APIKey = 'xxxxxxxxxxxxxxx';
$ListID = 'xxxxxxxxxxxxxxxxxx';
$email = "test@test.com";
$name = "test";

$s = new soapclient('http://api.createsend.com/api/api.asmx?wsdl',true); //or $s = new soapclient('http://api.createsend.com/api/api.asmx');

$prams = array('ApiKey' => $APIKey, 'ListID' => $ListID, 'Email' => $email, 'Name' => $name);

$rVal = $s->call('Subscriber.Add',$prams,'http://api.createsend.com/api/', 'http://api.createsend.com/api/Subscriber.Add','','','rpc','literal');

if(!$err = $s->getError()){
    echo 'Result Code '.$rVal['Code'].' - '.$rVal['Message'].'<br><br>';
}else{
    echo '<strong>Error:</strong> '.$err.'<br><br>';
}

if i use the ?wsdl for the client i get the error
'Error: operation Subscriber.Add not present.

if i use the non wsdl i get this
'Result Code 101 - Invalid ListID'

any help appreciated

thanks

natty, 8 years ago

well in case anyone cares.. found the answer

seems it preferred a call like this :
$res = $s->call('AddSubscriber',$prams,'http://api.createsend.com/api/', 'http://api.createsend.com/api/Subscriber.Add','','','rpc','literal');

200,000 companies around the world can't be wrong.

From Australia to Zimbabwe, and everywhere in between, companies count on 
Campaign Monitor for email campaigns that drive real business results.

Get started for free
1-888-533-8098