2016-01-10 2 views
0

Я хочу retieve данные подписки какПолучить Infusionsoft данные подписки для конкретного идентификатора пользователя

Контакты Id

SubscriptionPlanId

StartDate

EndDate

NextBillDate

Статус

так я создал код

/* */ 
###Include our XMLRPC Library### 
###Set our Infusionsoft application as the client### 
$client = new xmlrpc_client("https://ab2134.infusionsoft.com/api/xmlrpc"); 
###Return Raw PHP Types### 
$client->return_type = "phpvals"; 
###Dont bother with certificate verification### 
$client->setSSLVerifyPeer(FALSE); 
###Build a Key-Value Array to store a contact### 
$contact = array('Id','StartDate','EndDate','Status'); 
//$infusionemail=$this->SanitizeForSQL($emails); 
$infusionemail="[email protected]"; 
###Set up the call### 
$call = new xmlrpcmsg("DataService.findByField", array(
php_xmlrpc_encode($this->infusion_api), #The encrypted API key 
php_xmlrpc_encode("RecurringOrder"), 
php_xmlrpc_encode("50"), 
php_xmlrpc_encode("50"), 
php_xmlrpc_encode("Id"), 
php_xmlrpc_encode("15963"), 
//php_xmlrpc_encode($infusionemail), 
php_xmlrpc_encode($contact) #The contact array 
)); 
###Send the call### 
$result = $client->send($call); 
$resultArray = $result->value(); 
/**/###Check the returned value to see if it was successful and set it to a variable/display the results### 
echo "Infusion ID=".$resultArray[0]['Id']."<br/>Infusion Start date=".$resultArray[0]['StartDate']."<br/>Infusion EndDate=".$resultArray[0]['EndDate']."<br/>Infusion Status=".$resultArray[0]['Status']; 
} 

его не возвращает ничего может кто-нибудь помочь мне в этом

ответ

0

Это было бы гораздо проще с одной из существующих библиотек API Infusionsoft, а не пытаться создать XML-RPC звонки вручную. Проверьте большие Dev ресурсы здесь: https://developer.infusionsoft.com/docs/xml-rpc/#data-find-a-record-by-matching-a-specific-field

Например, с SDK, вы можете попробовать:

$app = new iSDK(); 
// perform authorization tasks 

$returnFields = array('Id','StartDate','EndDate','Status'); 
$orders = $app->dsFind('RecurringOrder',5,0,'Id',15963,$returnFields); 

Наконец, какой бы ни метод вы решите пойти с, всегда проверяйте ошибки возвращается как они часто скажите вам, в чем проблема! :)

Смежные вопросы