Get referral links and tracking status via API


(Erik Pires) #1

Hi,

i´m having trouble finding if it´s possible to get the list of affiliate sales websites and the link tracking status, is it possible?

thanks


(John Borelli) #2

There is a Referral Partner Redirect Activity Summary report that shows activity for the referral links, but if you want their websites and they are not actually triggering referral sales through there websites then the only way to get that information would be if you stored it somewhere first (their contact record for example). Such might be the case in an email only campaign by a referral partner for example.


(Erik Pires) #3

can i get the Referral Partner Redirect Activity Summary report with the
api? Which table is it? i can´t find

thanks


(John Borelli) #4

There isn’t a table for this. What you have to do is pull up the report in the UI and save a search. Then, with the api method $app->getAvailableFields($savedSearchId, $userId), you can pull the results of that saved search.


(Pav) #5

The API Saved Search functions can be found here:

https://developer.infusionsoft.com/docs/xml-rpc/#search

You use the “Retrieve Search Report” or “Retrieve Partial Report” API functions.
1000 Records are returned per Page.

Note, with Saved Searches you cannot modify the search criteria via the API. You have to set these up manually in the search.


(John Borelli) #6

I mis-copied the wrong method. You don’t have to specify the fields in the saved search if you use:

$infusionsoft->search()->getSavedSearchResultsAllFields($savedSearchID, $userID, $pageNumber)

Then just “cherry pick” what you need.


(Erik Pires) #7

thank you both very much!


(Erik Pires) #8

another related issue i´m having is that when i use the
$infusionsoft->affiliates()->getRedirectLinksForAffiliate($affiliateId)
it returns empty, but in the referral partner center, in the area *My Sales
Websites, *shows 2 links

am i getting wrong or the *getRedirectLinksForAffiliate *should return
those links?

ps: i´m certain im using the correct affiliateid cause the links to the
referral center is like this:
*https://xxx.infusionsoft.com/app/affiliate/manageAffiliate?affiliateId=18
https://xxx.infusionsoft.com/app/affiliate/manageAffiliate?affiliateId=18 *

so im using the id* 18*

thanks


(Pav) #9

I did a test against the Legacy iSDK and was able to pull the Redirect Links.

Double check your code, then double check if the PHP iSDK is okay with that function.

An example of what you should get back.

Array
(
[0] => Array
(
[Id] => 1
[RedirectUrl] => https://mywebsite.com/
[LocalUrl] => test
[ForwardQs] => 0
[AffiliateId] => 1
[Name] => Test
)
)


(Erik Pires) #10

that is not much to it

$affiliateId = 18;
$data =
$infusionsoft->affiliates()->getRedirectLinksForAffiliate($affiliateId);

print_r($data);

i tried in the old isdk also with the same empty result

$affiliateId = 18;
$data = $app->getRedirectLinksForAffiliate($affiliateId);

print_r($data);

the connection with infusion is fine since if i run other commands, they
work fine

any idea what could possibly be?


(Erik Pires) #11

tried with another infusionsoft account and also return empty

the links that this comand should return are the link in the referral
partner page in the menu Link Generator > My sales Websites, right?

so if that is links there, it shouldn´t return empty, am i correct?

thanks


(John Borelli) #12

I know this is going to sound abased to ask but are you certain that your access token is the one registered to the authorization of the app? With this working everywhere else “in the world” it’s all I can think of. If you ask support to monitor the call maybe they could tell you what’s happening from the logs on their end?


(Pav) #13

I bet it must be something simple that is going wrong here.

Firstly, have you checked any other Affiliate apart from ID 18. Are they IDs matching up correctly?

Secondly, have you tried creating a new Affiliate with links. Try to see if you can get the data for that.

Thirdly, is there a chance that you are connecting to the right Infusionsoft Account?

Otherwise, raise a Developer Support Ticket to see if there is something wrong in the account.

https://developer.infusionsoft.com/support/tickets/create/


(Erik Pires) #14

i´ve tried different affiliates and different infusionsoft accounts, i can
get the rest of their information correctly like commissions, but the links
always returns empty

unlikely the be the account, because like i said i have access to more than
one and is the same with all of them


(Pav) #15

Okay, now I see what is going wrong here. When I tested it against my account, it is returning the links. But testing against another account it was not.

The API is using the Affiliates referenced in the “Referral tracking links” section. It is not their Affiliate Login - My Sales Website links at all.

I cannot see anything directly to get those links. Not even a Saved Search is possible in that section either. Unless someone else knows?


(Erik Pires) #16

Ok Pav, thank you very much!! still cant find the links tho, if anyone else
knows, please, it would be a great help!


(John Borelli) #17

The only option I can see to get the web address links is to do an export from the referral tracking links option.


(Erik Pires) #18

like manually or via api? If by api, how could i do that?


(Erik Pires) #19

and could i pull the statistics for that affiliate link?

thanks


(John Borelli) #20

I’m not referring through the api as we’ve already stated, that isn’t offered. The export would only give you the list. To get statistics you would need to have your affiliates install the tracking link code under lead generation on their sites.