我正在使用Infusionsoft API與諾瓦克SDK。Infusionsoft:使用自定義字段檢索聯繫人(諾瓦克SDK)
我的PHP網站有一個username
會話值,它與聯繫人的自定義字段(也稱爲username
)內的唯一值匹配。我想使用網站的會話值查詢Infusionsoft API,並讓它返回唯一的聯繫人記錄。獲得聯繫人記錄後,我需要確定聯繫人的ID。我該怎麼做呢?
我決定重命名並重新使用「名字」字段(將其更改爲「用戶名」)而不是使用自定義字段。
做這樣的說法我有一些代碼工作:
<?php
// Include the SDK
require_once('Infusionsoft/infusionsoft.php');
//Get username value from session
$UserName = $_SESSION["Username"];
//Query contacts table using first name
$contacts = Infusionsoft_DataService::query(new Infusionsoft_Contact(), array('FirstName' => $UserName));
$contact = array_shift($contacts);
//This is the Contact ID
$contactID = $contact->Id;
//This is the Tag ID
$groupID = 105;
//Tag a user using the Contact ID and Tag ID
Infusionsoft_ContactService::addToGroup($contactID , $groupID);
你應該進入一些你已經嘗試過的,以及遇到什麼障礙:http://www.sscce.org –