Forum
Community Login
Infusionsoft Community
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Trying to Query my Recurring Table... (1 viewing) (1) Guests
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Trying to Query my Recurring Table...
#2848
Matt31 (User)
Junior Boarder
Posts: 9
graphgraph
User Offline Click here to see the profile of this user
Trying to Query my Recurring Table... 1 Year ago Karma: 0  
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
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#3048
Eric (User)
Gold Boarder
Posts: 136
graphgraph
User Offline Click here to see the profile of this user
Re:Trying to Query my Recurring Table... 11 Months, 3 Weeks ago Karma: 15  
The paging through the API is 0-based. Change the page to 0, and you should get your records.
 
Report to moderator   Logged Logged  
 
-- Eric Martineau --
Chief Software Architect
Infusionsoft
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop