-1

我将Infusionsoft APINovak 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);
4

2 回答 2

0

我决定重命名并重新使用“名字”字段(将其更改为“用户名”),而不是使用自定义字段。

这样做我得到了一些代码:

<?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);

//---

这就是我所拥有的!

谢谢。

于 2015-08-31T13:43:46.323 回答
0
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
于 2017-01-27T11:00:57.247 回答