|
Here there...I am new to this API, but I am having a problem accessing the Recurring Table with a field other than the ID. Below is the code (of both attempts)...the results are below that. I get no errors, but I assume that it just is coming back with an empty array (i.e., it can't find it!). What do you think? cheers...matt
*********** CODE *********** #----------------------------------------------------------------------------------------------# #-------------------------------------- LIST RECURRING BY CONTACT ID ------------------------# #----------------------------------------------------------------------------------------------# $call = new xmlrpcmsg("DataService.findByField", array( php_xmlrpc_encode($key), php_xmlrpc_encode("RecurringOrder"), #The table to search in php_xmlrpc_encode(50), #Field to search on php_xmlrpc_encode(1), #Field to search on php_xmlrpc_encode("ContactId"), #Field to search on php_xmlrpc_encode(73223), #Field to search on php_xmlrpc_encode(array("Id","ProgramId","Status","AutoCharge", "ContactId")) ) #What fields to select ); $result = $client->send($call); if(!$result->faultCode()) { #The results are returned as an array of structs (stored as referenced arrays) #Loop through each item and print values out to screen $item = $result->value(); echo "Id:" . $item["Id"].""; echo "Program ID:" . $item["ProgramId"].""; echo "Status:" . $item["Status"].""; echo "AutoCharge:" . $item["AutoCharge"].""; echo "ContactId:" . $item["ContactId"].""; } else { print $result->faultCode() . ""; print $result->faultString() . ""; }
#----------------------------------------------------------------------------------------------# #-------------------------------------- LIST RECURRING BY ID --------------------------------# #----------------------------------------------------------------------------------------------#
$call = new xmlrpcmsg("DataService.load", array( php_xmlrpc_encode($key), php_xmlrpc_encode("RecurringOrder"), #The table to search in php_xmlrpc_encode(71), #Field to search on php_xmlrpc_encode(array("Id","ProgramId","Status","AutoCharge", "ContactId")) ) #What fields to select ); $result = $client->send($call); if(!$result->faultCode()) { #The results are returned as an array of structs (stored as referenced arrays) #Loop through each item and print values out to screen $item = $result->value(); echo "Id:" . $item["Id"].""; echo "Program ID:" . $item["ProgramId"].""; echo "Status:" . $item["Status"].""; echo "AutoCharge:" . $item["AutoCharge"].""; echo "ContactId:" . $item["ContactId"].""; } else { print $result->faultCode() . ""; print $result->faultString() . ""; }
**************** RESULTS (OUTPUT) ****************
Id: Program ID: Status: AutoCharge: ContactId: Id:71 Program ID:9 Status:Active AutoCharge:1 ContactId:73223
|