[英]Infusionsoft: Retrieve Contact Using A Custom Field (Novak SDK)
我將Infusionsoft API與Novak 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);
我決定重命名並重新分配“名字”字段(將其更改為“用戶名”),而不是使用自定義字段。
這樣做我有一些代碼可以工作:
<?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);
//---
這就是我所擁有的!
謝謝。
include('Infusionsoft/infusionsoft.php');
$contact = new Infusionsoft_Contact();
$contact->FirstName = 'John';
$contact->LastName = 'Doe';
$contact->save();
https://github.com/novaksolutions/infusionsoft-php-sdk/wiki/Examples
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.