FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » xml rpc request with mynewsletter builder
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
xml rpc request with mynewsletter builder [message #174840] Wed, 13 July 2011 04:17 Go to previous message
cerr is currently offline  cerr
Messages: 33
Registered: September 2010
Karma:
Member
Hi Tghere,

I need to execute a certain function from mynewsletterbuilder.
It's got documentation but I don't get it working correctly :( Not sure if I don't read the docu correctly or what... :(
The link to the docu is http://www.mynewsletterbuilder.com/api/docs/1.0/Subscribe
and with my code all i'm getting back is:
Fault: Code: -32602 Message: server error. invalid method parameters

My code looks like this:
<?php
require_once "./xmlrpc.inc";

$api_key = 'MyAPIcode';

$details = array(
'email' => 'test(at)example(dot)com',
'first_name' => '',
'middle_name' => '',
'last_name' => '',
'full_name' => '',
'company_name' => '',
'job_title' => '',
'phone_work' => '',
'phone_home' => '',
'address_1' => '',
'address_2' => '',
'address_3' => '',
'city' => '',
'state' => '',
'zip' => '',
'country' => ''
);

$lists = array(MyListID);

$skip_opt_in = FALSE;

$update_existing = TRUE;

$retval = new xmlrpcmsg('Subscribe',
array(new xmlrpcval($api_key),
new xmlrpcval($details),
new xmlrpcval($lists),
new xmlrpcval($skip_opt_in),
new xmlrpcval($update_existing)
));

$c = new xmlrpc_client("/1.0/", "api.mynewsletterbuilder.com", 80);
$c->return_type = "phpvals";
$r = $c->send($retval);

if (!$r->faultCode())
echo "Response: " . $r->value();
else
{
echo "Fault:\n"
. " Code: " . htmlentities($r->faultCode()) . "\n"
. " Message: " . htmlentities($r->faultString()) . "\n";
}
?>
Does anyone see what I'm doing wrong??? I don't see it... :(
Help is greatly appreciated!

Thank you!
Ron
[Message index]
 
Read Message
Read Message
Previous Topic: Do you know comp.lang.php is the 'bigger' news group.
Next Topic: Problem with special char in MySQL and XML
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 19:53:34 GMT 2024

Total time taken to generate the page: 0.06248 seconds