I have this code to find a contact in GetResponse to see if it exists. The first part (getting the campaign) works, but getting the contact fails in an exception: Request have return error: Invalid params:
<?php
$jsonfile = 'jsonrpcclient.php';
if (file_exists($jsonfile))
{
require_once $jsonfile;
$api_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$api_url = 'http://api2.getresponse.com';
$client = new jsonRPCClient($api_url);
$result = NULL;
// Get campaign
try
{
$result = $client->get_campaigns(
$api_key,
array (
'name' => array ( 'EQUALS' => 'my_customer_list' )
)
);
}
catch (Exception $e)
{
die($e->getMessage());
}
$campaigns = array_keys($result);
$CAMPAIGN_ID = array_pop($campaigns);
// Lookup contact
try
{
$result = $client->get_contacts(
$api_key,
array (
'campaigns' => $CAMPAIGN_ID,
'email' => $track_order_email
)
);
}
catch (Exception $e)
{
die($e->getMessage());
}
}
else
{
echo "Json include file NOT found";
}
?>
Any help would be appreciated in formatting the get_contacts parameters.