Community Login
Infusionsoft Community
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Lookup Affiliate Referral with API, Help Needed (1 viewing) (1) Guests
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Lookup Affiliate Referral with API, Help Needed
#8227
marcpsummers (User)
CMAC
Posts: 124
graphgraph
User Offline Click here to see the profile of this user
Lookup Affiliate Referral with API - Code Help Ple 4 Weeks, 1 Day ago Karma: 7  
I am trying to get the affiliate id from the Referral table (which I have managed) - but now I need to ensure it is the latest affiliate and not already expired.

this is what I am doing...

Code: :

      $app = new iSDK;     $app->cfgCon("InfusionSoftApp"); $cid=(int)$cid ; $returnF = array('AffiliateId'); $query = array('ContactId' => $cid); $referral $app->dsQuery("Referral",1,0,$query,$returnF); $refid=$referral[0]['AffiliateId']; echo $refid;



So i need to add a where 'DateExpires' is not older than 30 days and the latest one if multiples are in the array.

Anyone able to help with how I correct my $query?
 
Report to moderator   Logged Logged  
 
Marc P Summers
InfusionSoft Certified marketing Automation Coach
Monkey Design House
Automated MarketingInfusionSoft UK ConsultancySEO Trainer
  The administrator has disabled public write access.
#8365
marcpsummers (User)
CMAC
Posts: 124
graphgraph
User Offline Click here to see the profile of this user
Re:Lookup Affiliate Referral with API, Help Needed 2 Weeks, 5 Days ago Karma: 7  
Does anyone have any ideas with this?
 
Report to moderator   Logged Logged  
 
Marc P Summers
InfusionSoft Certified marketing Automation Coach
Monkey Design House
Automated MarketingInfusionSoft UK ConsultancySEO Trainer
  The administrator has disabled public write access.
#8367
techportal (User)
CMAC
Posts: 226
graphgraph
User Online Now Click here to see the profile of this user
Re:Lookup Affiliate Referral with API, Help Needed 2 Weeks, 5 Days ago Karma: 7  
Since you are only pulling a single record, you will never see more than one. For starters, you will have to set that number higher.

You will also need to pull in the fields "DateSet" and "DateExpires" to get the additional criteria.

You will have to loop through the resulting array in PHP and select the record which meets your internal requirements.

** Can't post the full code, forum needs fixin' **

Code: :

  $app = new iSDK; $app->cfgCon("InfusionSoftApp"); $cid=(int)$cid ; $returnF = array('AffiliateId','DateSet',DateExpires'); $query = array('ContactId' => $cid); IF ($referrals = $app->dsQuery("Referral",1000,0,$query,$returnF)) :   $query_ok = TRUE; ELSE :   $query_ok = FALSE; ENDIF; $refid = false; $newest = ''; IF ($query_ok) :   FOREACH ($referrals as $k => $referral) :     IF ($referral['DateExpires

 
Report to moderator   Logged Logged  
 
Last Edit: 2009/11/02 11:54 By techportal.
 
Bob Keen
https://www.InfusionWP.com - TurboCharge InfusionSoft with WordPress Membership Sites!

http://www.infusionsoftkunaki.com - Full Kunaki/Infusionsoft Gateway Solution

http://infusionsoft1clickupsell.com/ - Don't miss a launch and don't lose a single sale
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop