Affiliate Marketing ·

Using The AvantLink API To Streamline Your Affiliate Efforts

Justin Ball

Lamborghini

It Would Be Really Cool If…

Open All The Things!

Open All The Things

  • Open Source
  • APIs
  • Open Content

Open Source

Canvas LTI screenshot

  • Moved from installs to services
  • Developers read the code. Create better integrations
  • Result is a healthy community of applications

Open Content

  • Kahn Academy
  • MIT Open Courseware
  • Creative Commons

Users win with cool remixes

Organizations (and professors) win with brand recognition

APIs

Symbiotic Relationship

Developers imagine new features for your platform.

Platform wins new functionality and profits.

Developer wins large audience and profits.

Please implement OAuth

Everyone else is doing it

and standards make things easy

Cool Story Bro

AvantLink API documentation screenshot

Merchant API

AvantLink API documentation merchant screenshot

Ignore This

Affiliate API

AvantLink API documentation affiliate screenshot

Affiliate API

AvantLink API documentation affiliate screenshot

Getting Started

Everything is a GET

Just like your browser

Looks like this:

http://www.avantlink.com/api.php?affiliate\_id=28861&module=CustomLink&output=csv&merchant\_id=10060&website\_id=37705&merchant\_url=http%3A%2F%2Fwww.backcountry.com%2Fibis-ripley

The Request Builder is very handy

Base url

http://www.avantlink.com/api.php

http://www.avantlink.com/api.php?affiliate\_id=28861&module=CustomLink&output=csv&merchant\_id=10060&website\_id=37705&merchant\_url=http%3A%2F%2Fwww.backcountry.com%2Fibis-ripley

Common Parameters

  • affiliate_id=28861
  • module=CustomLink
  • output=csv

http://www.avantlink.com/api.php?affiliate\_id=28861&module=CustomLink&output=csv&merchant\_id=10060&website\_id=37705&merchant\_url=http%3A%2F%2Fwww.backcountry.com%2Fibis-ripley

Parameters:

http://www.avantlink.com/api.php?affiliate\_id=28861&module=CustomLink&output=csv&merchant\_id=10060&website\_id=37705&merchant\_url=http%3A%2F%2Fwww.backcountry.com%2Fibis-ripley

Parameters:

  • module=ProductSearch
  • output=csv,html,js,rss,tab,xml,json
  • website_id=37705
  • search_term=ibis

https://www.avantlink.com/api.php?module=ProductSearch&affiliate\_id=28861&website\_id=37705&search\_term=ibis

SnapLinker

SnapLinker search interface

Search Example

        var query = 'ibis';
var page = 0;
var resultCount = 8;
var url = 'http://www.avantlink.com/api.php?affiliate_id=28861';
url += '&module=ProductSearch&output=json&website_id=37705';
url += '&search_results_count=' + resultCount;
url += '&search_term=' + encodeURIComponent(query);
url += '&search_results_base=' + (page * resultCount);

$('#searchExampleA').attr('href', url).text(url);

$.getJSON(url).done(function(data, textStatus, jqXHR){
  $('#searchExampleOutput').empty();
  $.each(data, function(idx, result){
    if(result){
      $('#searchExampleOutput').append(render(result));
    }
  });
});

function render(result){
  var url = 'http://www.avantlink.com/click.php?tt=app&ti=1021&pw=37705' +
    '&mi=' + result.lngMerchantId +
    '&df=' + result.lngDatafeedId +
    '&pri=' + result.lngProductId;
  var image = result.strThumbnailImage || result.strMediumImage;

  var html = '<' + 'div class="search-result">';
  html += '<' + 'a href="' + url + '" target="_blank">';
  html += '<' + 'img src="' + image + '" alt="' + result.strProductName + '" />';
  html += '<' + '/a>';
  html += '<' + 'p class="price small">$' + result.dblProductPrice + '<' + '/p>';
  html += '<' + '/div>';

  return html;
}

//url += '&search_on_sale_only=1';
//url += '&search_on_sale_level=10';
//url += '&search_price_maximum=1000';
//url += '&search_price_minimum=10';

// Boolean, enables the use of advanced search syntax, causing special treatment in the following circumstances:
// preceding a word with "+" will restrict the search to ONLY products that mention that word, preceding a
// word with "-" will restrict the search to exclude any products that mention that word, and the keyword "
// OR " can be used to perform multiple simultaneous searches (in place of OR you can use the pipe character "|"
// to separate multiple search terms).
//url += '&search_advanced_syntax=1';

//url += '&search_brand=ibis';           // A product brand to which search results should be restricted (strict filter only; does not allow wildcards).
//url += '&search_category=bikes';       // A product category to which search results should be restricted.
//url += '&search_department=clothing';  // A department to which search results should be restricted.
//url += '&merchant_ids=10060';
//url += '&search_results_sort_order=Sale+Price';

        
      

Deal of the Day (DOTD)

Parameters:

  • module=DotdFeed
  • output=csv,html,js,rss,tab,xml,json
  • website_id=37705
  • layout_id=1

DOTD

http://www.avantlink.com/api.php?affiliate\_id=28861&module=DotdFeed&website\_id=37705&output=html&layout\_id=1

Data Feeds

Parameters:

  • module=SubscriptionFeed
  • output=csv,tab,xml
  • auth_key=908d7de89a595f9d1548s7d77d260e457
  • website_id=43557

List Data Feeds

https://www.avantlink.com/api.php?affiliate\_id=29689&auth\_key=78163e89a595f9d154370967d260e457&module=SubscriptionFeed&output=xml&subscription\_type=df&website\_id=43557

Using the API for reports

Parameters:

  • module=AffiliateReport
  • output=csv,html,tab,xml
  • auth_key=908d7de89a595f9d1548s7d77d260e457
  • report_id=1

Reports

  • 1 – Performance Summary
  • 2 – Ad Impressions (Summary)
  • 3 – Ad Impressions (Detail)
  • 5 – Click Throughs (Summary)
  • 6 – Click Throughs (Detail)
  • 8 – Sales/Commissions (Detail)
  • 9 – Performance Summary By Tool Type
  • 12 – Performance Summary By Day
  • 19 – Sale Hit Tracking Trails
  • 20 – Performance Summary By Affiliate Website
  • 22 – Performance Summary By Custom Tracking Code
  • 23 – Invalid Affiliate Links
  • 24 – Performance Summary By Ad Campaign
  • 29 – Performance Summary By Hour
  • 31 – Performance Summary By Product
  • 33 – Performance Summary By Merchant Grouping
  • 47 – Merchant Ranking By Earnings
  • 48 – Performance Summary By Month
  • 50 – Performance Summary By Week
  • 72 – Last Click Through to Sale Summary
  • 77 – Performance Summary By Paid Placement
  • 81 – Datafeeds: Merchant Datafeed Quality

Peformance Summary

https://www.avantlink.com/api.php?affiliate\_id=29689&auth\_key=78163e89a595f9d154370967d260e457&module=AffiliateReport&output=html&report\_id=1

App Market

SnapLinker

SnapLinker interface

SnapSearcher

SnapSearcher interface

SnapSearcher

GearShop.me

SnapSearcher Source on Github

Questions?

Justin Ball

$(function(){ $('#report-request').on('keyup', function(){ var id; $.each($(this).val().split('?')\[1\].split('&'), function(i, params){ if(params.indexOf('report\_id')==0){ id = params.split('=')\[1\]; } }); switch(id){ case "1": title = "Performance Summary"; break; case "2": title = "Ad Impressions (Summary)"; break; case "3": title = "Ad Impressions (Detail)"; break; case "5": title = "Click Throughs (Summary)"; break; case "6": title = "Click Throughs (Detail)"; break; case "8": title = "Sales/Commissions (Detail)"; break; case "9": title = "Performance Summary By Tool Type"; break; case "12": title = "Performance Summary By Day"; break; case "19": title = "Sale Hit Tracking Trails"; break; case "20": title = "Performance Summary By Affiliate Website"; break; case "22": title = "Performance Summary By Custom Tracking Code"; break; case "23": title = "Invalid Affiliate Links"; break; case "24": title = "Performance Summary By Ad Campaign"; break; case "29": title = "Performance Summary By Hour"; break; case "31": title = "Performance Summary By Product"; break; case "33": title = "Performance Summary By Merchant Grouping"; break; case "47": title = "Merchant Ranking By Earnings"; break; case "48": title = "Performance Summary By Month"; break; case "50": title = "Performance Summary By Week"; break; case "72": title = "Last Click Through to Sale Summary"; break; case "77": title = "Performance Summary By Paid Placement"; break; case "81": title = "Datafeeds: Merchant Datafeed Quality"; break; default: title = "Report"; } $('#report-title').text(title); }); });