Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #2524 > unrolled thread

xml rpc request with mynewsletter builder

Started bycerr <ron.eggler@gmail.com>
First post2011-07-12 21:17 -0700
Last post2011-07-13 05:44 -0400
Articles 2 — 2 participants

Back to article view | Back to comp.lang.php


Contents

  xml rpc request with mynewsletter builder cerr <ron.eggler@gmail.com> - 2011-07-12 21:17 -0700
    Re: xml rpc request with mynewsletter builder Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-13 05:44 -0400

#2524 — xml rpc request with mynewsletter builder

Fromcerr <ron.eggler@gmail.com>
Date2011-07-12 21:17 -0700
Subjectxml rpc request with mynewsletter builder
Message-ID<db39635b-5066-4203-8723-2c9a02feb987@glegroupsg2000goo.googlegroups.com>
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@example.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

[toc] | [next] | [standalone]


#2527

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-07-13 05:44 -0400
Message-ID<ivjpea$pcn$1@dont-email.me>
In reply to#2524
On 7/13/2011 12:17 AM, cerr wrote:
> 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@example.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

I'd suggest you start by asking mynewsletterbuilder support.  The 
problem is obviously their code does not like the parameter list you are 
sending it.

When working with a product, the best place to ask for help is almost 
always with that product - they know their code much better than anyone 
else.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web