SlideShare uma empresa Scribd logo
1 de 19
Baixar para ler offline
Best Ways to
Use the API
ShareASale Think Tank 2013
Eric Nagel
eric@ericnagel.com
What is the ShareASale API?
● API = Application Programming Interface
○ An application programming interface (API) specifies
how some software components should interact with
each other.
○ It’s a way for your website to talk directly to the
ShareASale system

● Affiliate API
● Merchant API
Where to find the ShareASale API
Affiliate API Under
Tools

Merchant API
Under Tools
Affiliate API: Authentication
The Authentication Hash
Authentication Hash : SHA-256 Hash in 64 character Hex format of the string "YourAPIToken:CurrentDateInUTCFormat:
APIActionValue:YourAPISecret" (without quotes)

For example, for following values:
Token: NGc6dg5e9URups5o
API Secret: ATj7vd8b7CCjeq9yQUo8cc2w3OThqe2e
String to Hash: NGc6dg5e9URups5o:Thu, 14 Apr 2011 22:44:22 GMT:bannerList:ATj7vd8b7CCjeq9yQUo8cc2w3OThqe2e
UTC Date: Thu, 14 Apr 2011 22:44:22 GMT
API Action: bannerList

The correct HTTP Headers would be:
x-ShareASale-Date: Thu, 14 Apr 2011 22:44:22 GMT
x-ShareASale-Authentication: 78D54A3051AE0AAAF022AA2DA230B97D5219D82183FEFF71E2D53DEC6057D9F1
Affiliate API: Authentication
IP Restrictions

Start > Run
cmd
ping domain.com
Gives you the IP

These are the IPs that will be accessing the
data. Since the script will reside on your
server, use your server’s IP.
Affiliate API: Authentication

HUH????
Don’t worry.
1. Click “View Sample code in PHP”
2. Copy
3. Paste
4. Change values
Affiliate API: Sample
<?php

$myAffiliateID = '';

Get these values from the API page

$APIToken = "";
$APISecretKey = "";
$myTimeStamp = gmdate(DATE_RFC1123);

$APIVersion = 1.8;

We’ll get
to this

$actionVerb = "activity";
$sig = $APIToken.':'.$myTimeStamp.':'.$actionVerb.':'.$APISecretKey;

$sigHash = hash("sha256",$sig);

$myHeaders = array("x-ShareASale-Date: $myTimeStamp","x-ShareASale-Authentication: $sigHash");
Affiliate API: Sample
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://shareasale.com/x.cfm?
affiliateId=$myAffiliateID&token=$APIToken&version=$APIVersion&action=$actionVerb");
curl_setopt($ch, CURLOPT_HTTPHEADER,$myHeaders);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, 0);

$returnResult = curl_exec($ch);

Nothing to
do here.
Affiliate API: Sample
if ($returnResult) {
//parse HTTP Body to determine result of request
if (stripos($returnResult,"Error Code ")) {
// error occurred
trigger_error($returnResult,E_USER_ERROR);
}
else{
// success
echo $returnResult;
}

This is where you take over and
put in your custom coding to do
whatever you want with the data.

}
else{
// connection error
trigger_error(curl_error($ch),E_USER_ERROR);
}
Affiliate API
●
●
●
●
●
●
●
●
●
●

Activity Details
Activity Summary
Merchant Timespan Report
Today's Stats
Monthly Summary
Void Trail
Traffic
API Token Count
Get Products
Invalid Links

●
●
●
●
●
●
●
●
●
●

Datafeed Merchants
Coupon/Deal Merchants
Merchant Status
Merchant Creatives
Merchant Gift Cards
Edit Trail
Payment Summary
Merchant Search
Merchant Search by Product
Ledger Report
Example
Use Activity Details to download transaction
data daily and store in your tracking system or
email you your commissions.
Trans ID|User ID|Merchant ID|Trans
Date|Trans
Amount|Commission|Comment|Voided|Pendin
g Date|Locked|Aff Comment|Banner
Page|Reversal Date|Click Date|Click
Time|Banner Id
37697968|132296|8723|10/16/2012 11:41:05
AM|323.7|71.21|Sale - 620946||||WCG45500|http://www.wineclubreviewsandratings.
com/cellars-wine-club/sparkling-champagneclub-review||2012-10-16 00:00:00.0|11:34:11
AM|43027
Example
Use Coupon / Deal Merchants to download
coupons to show on your website
Deal Id|Merchant Id|Merchant|Start Date|End
Date|Publish Date|Title|Image(big)|Tracking
URL|Image(small)
|Category|Description|Restrictions|Keywords|C
oupon Code|Edit Date
12104|8684|Checks Unlimited|2009-06-15 00:
00:00.0|2050-12-31 00:00:00.0|2008-08-23 18:
09:10.0|Personal checks, additional 10% off
reorder check pricing.|http://|http://www.
shareasale.com/u.cfm?
d=12104&m=8684&u=132296|http://||Personal
checks only - additional 10% off reorder check
pricing default online.|||PJKA|2009-06-18 12:
26:34.0
Other Affiliate API Uses
● Get Products
○ Search by keyword
to return products for
a datafeed site

● Invalid Links
○ Make sure you’re not
wasting your traffic

● Merchant Status
○ Be alerted when
merchants go offline

● Merchant Creatives
○ Get the latest
banners from
merchants who run
seasonal offers
What Do I Do Now?
● Process the data
○
○
○

See fgetcsv(), split(), explode()
Save to database
Send an email

● Automate your script
○

Set up a “cron” to have the script run on a regular basis

● More help?
○
○

http://www.ericnagel.com/how-to-tips/shareasale-api.html
■ 4 years old, but it still works.
http://www.ericnagel.com/how-to-tips/shareasale-prosper202.html
■ If you use Prosper202
Tips
● You have limited API calls. Use them wisely.
○ 200 / month = less than 7 per day
i.
ii.
iii.
iv.
v.
vi.

Activity Details
Traffic
Get Products
Invalid Links
Coupon / Deal Merchants
Merchant Status
Tips
● While you’re writing your script to process
the data, download the data once, then use
the local file for processing. This way, only 1
API call will be used.
○

$cURL = 'https://shareasale.com/x.cfm?
action=couponDeals&affiliateId=132296&token=az7bFTu3LwioXNRA
&XMLFormat=0';
// $cURL = 'sas.csv';
$fp = fopen($cURL, "r");
Tips
Since we’re talking about APIs, why not combine a
merchant’s direct API with the ShareASale API?
● Get data from merchant’s own API
● Change links to ShareASale Deeplinks
● …
● Profit
http://www.wyzant.com/AffiliateProgram/
Resources
●

http://blog.shareasale.com/author/ryan/
○ Ryan Frey writes about using all the ShareASale techie things

●

http://www.ericnagel.com/tag/shareasale
○ I have a few blog posts about ShareASale - keep digging

●

http://www.programmableweb.com/api/shareasale-affiliate
○ Programmable Web is all things API
Questions?
Eric Nagel
Email: eric@ericnagel.com
Website: www.ericnagel.com
Twitter: @ericnagel

Mais conteúdo relacionado

Destaque (20)

BPE USA agenda - Full Agenda
BPE USA agenda - Full AgendaBPE USA agenda - Full Agenda
BPE USA agenda - Full Agenda
 
Streams API (Web Engines Hackfest 2015)
Streams API (Web Engines Hackfest 2015)Streams API (Web Engines Hackfest 2015)
Streams API (Web Engines Hackfest 2015)
 
MakkelijkLezenPlein deel 2 Theek 5
MakkelijkLezenPlein deel 2 Theek 5MakkelijkLezenPlein deel 2 Theek 5
MakkelijkLezenPlein deel 2 Theek 5
 
セミナープレゼン資料【Adingo】 20130530 
セミナープレゼン資料【Adingo】 20130530 セミナープレゼン資料【Adingo】 20130530 
セミナープレゼン資料【Adingo】 20130530 
 
Oipf
OipfOipf
Oipf
 
Presentatie handicap en studie
Presentatie handicap en studiePresentatie handicap en studie
Presentatie handicap en studie
 
DCU School of Physical Sciences
DCU School of Physical SciencesDCU School of Physical Sciences
DCU School of Physical Sciences
 
Hbbtv
HbbtvHbbtv
Hbbtv
 
MMD_Vision 2015
MMD_Vision 2015MMD_Vision 2015
MMD_Vision 2015
 
Gabor Karcis portfolio
Gabor Karcis portfolioGabor Karcis portfolio
Gabor Karcis portfolio
 
Почта ukr.net
 Почта ukr.net Почта ukr.net
Почта ukr.net
 
KW Outfront Magazine Online March/April 2009
KW Outfront Magazine Online  March/April 2009KW Outfront Magazine Online  March/April 2009
KW Outfront Magazine Online March/April 2009
 
9. Il Web semantico
9. Il Web semantico9. Il Web semantico
9. Il Web semantico
 
Baqmar 2014
Baqmar 2014Baqmar 2014
Baqmar 2014
 
SAPIENS2009 - Module 4B
SAPIENS2009 - Module 4BSAPIENS2009 - Module 4B
SAPIENS2009 - Module 4B
 
Fas drs power_point_2003
Fas drs power_point_2003Fas drs power_point_2003
Fas drs power_point_2003
 
In just five years 2011
In just five years 2011In just five years 2011
In just five years 2011
 
Deloitte Telecom Predictions 2010
Deloitte Telecom Predictions 2010Deloitte Telecom Predictions 2010
Deloitte Telecom Predictions 2010
 
Techbridge program
Techbridge programTechbridge program
Techbridge program
 
Global Warming
Global WarmingGlobal Warming
Global Warming
 

Semelhante a Best ways to use the ShareASale API

Preparing a WordPress Plugin for Translation
Preparing a WordPress Plugin for TranslationPreparing a WordPress Plugin for Translation
Preparing a WordPress Plugin for TranslationBrian Hogg
 
API Technical Writing
API Technical WritingAPI Technical Writing
API Technical WritingSarah Maddox
 
Metrics-Driven Engineering
Metrics-Driven EngineeringMetrics-Driven Engineering
Metrics-Driven EngineeringMike Brittain
 
Brian hogg word camp preparing a plugin for translation
Brian hogg   word camp preparing a plugin for translationBrian hogg   word camp preparing a plugin for translation
Brian hogg word camp preparing a plugin for translationwcto2017
 
Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015
Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015
Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015Codemotion
 
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop Apigee | Google Cloud
 
ApacheCon NA 2018 : Apache Unomi, an Open Source Customer Data Platformapache...
ApacheCon NA 2018 : Apache Unomi, an Open Source Customer Data Platformapache...ApacheCon NA 2018 : Apache Unomi, an Open Source Customer Data Platformapache...
ApacheCon NA 2018 : Apache Unomi, an Open Source Customer Data Platformapache...Serge Huber
 
Apache Unomi presentation and update. By Serge Huber, CTO Jahia
Apache Unomi presentation and update. By Serge Huber, CTO JahiaApache Unomi presentation and update. By Serge Huber, CTO Jahia
Apache Unomi presentation and update. By Serge Huber, CTO JahiaJahia Solutions Group
 
Lectura 2.4 is your api naked - 10 roadmap considerations
Lectura 2.4   is your api naked - 10 roadmap considerationsLectura 2.4   is your api naked - 10 roadmap considerations
Lectura 2.4 is your api naked - 10 roadmap considerationsMatias Menendez
 
REST API: A Real Case Scenario
REST API: A Real Case ScenarioREST API: A Real Case Scenario
REST API: A Real Case Scenariociacchi
 
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHPPHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHPiMasters
 
Webinar: API Extravaganza! Combining Google Analytics and ORCID API
Webinar: API Extravaganza! Combining Google Analytics and ORCID APIWebinar: API Extravaganza! Combining Google Analytics and ORCID API
Webinar: API Extravaganza! Combining Google Analytics and ORCID APIARDC
 
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017Amazon Web Services
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsTom Johnson
 
Go swagger tutorial how to create golang api documentation using go swagger (1)
Go swagger tutorial how to create golang api documentation using go swagger (1)Go swagger tutorial how to create golang api documentation using go swagger (1)
Go swagger tutorial how to create golang api documentation using go swagger (1)Katy Slemon
 
Introduction to trader bots with Python
Introduction to trader bots with PythonIntroduction to trader bots with Python
Introduction to trader bots with Pythonroskakori
 
Customer Automation Masterclass - Workshop 1: Data Enrichment using Clearbit
Customer Automation Masterclass - Workshop 1: Data Enrichment using ClearbitCustomer Automation Masterclass - Workshop 1: Data Enrichment using Clearbit
Customer Automation Masterclass - Workshop 1: Data Enrichment using ClearbitJanBogaert8
 

Semelhante a Best ways to use the ShareASale API (20)

Preparing a WordPress Plugin for Translation
Preparing a WordPress Plugin for TranslationPreparing a WordPress Plugin for Translation
Preparing a WordPress Plugin for Translation
 
API Technical Writing
API Technical WritingAPI Technical Writing
API Technical Writing
 
Metrics-Driven Engineering
Metrics-Driven EngineeringMetrics-Driven Engineering
Metrics-Driven Engineering
 
Brian hogg word camp preparing a plugin for translation
Brian hogg   word camp preparing a plugin for translationBrian hogg   word camp preparing a plugin for translation
Brian hogg word camp preparing a plugin for translation
 
Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015
Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015
Building Successful APIs Overnight - Orlando K - Codemotion Rome 2015
 
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
 
Tweak Geeks #FOS15
Tweak Geeks #FOS15Tweak Geeks #FOS15
Tweak Geeks #FOS15
 
ApacheCon NA 2018 : Apache Unomi, an Open Source Customer Data Platformapache...
ApacheCon NA 2018 : Apache Unomi, an Open Source Customer Data Platformapache...ApacheCon NA 2018 : Apache Unomi, an Open Source Customer Data Platformapache...
ApacheCon NA 2018 : Apache Unomi, an Open Source Customer Data Platformapache...
 
Apache Unomi presentation and update. By Serge Huber, CTO Jahia
Apache Unomi presentation and update. By Serge Huber, CTO JahiaApache Unomi presentation and update. By Serge Huber, CTO Jahia
Apache Unomi presentation and update. By Serge Huber, CTO Jahia
 
Lectura 2.4 is your api naked - 10 roadmap considerations
Lectura 2.4   is your api naked - 10 roadmap considerationsLectura 2.4   is your api naked - 10 roadmap considerations
Lectura 2.4 is your api naked - 10 roadmap considerations
 
REST API: A Real Case Scenario
REST API: A Real Case ScenarioREST API: A Real Case Scenario
REST API: A Real Case Scenario
 
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHPPHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
 
CiviCRM API v3
CiviCRM API v3CiviCRM API v3
CiviCRM API v3
 
CGI Presentation
CGI PresentationCGI Presentation
CGI Presentation
 
Webinar: API Extravaganza! Combining Google Analytics and ORCID API
Webinar: API Extravaganza! Combining Google Analytics and ORCID APIWebinar: API Extravaganza! Combining Google Analytics and ORCID API
Webinar: API Extravaganza! Combining Google Analytics and ORCID API
 
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIs
 
Go swagger tutorial how to create golang api documentation using go swagger (1)
Go swagger tutorial how to create golang api documentation using go swagger (1)Go swagger tutorial how to create golang api documentation using go swagger (1)
Go swagger tutorial how to create golang api documentation using go swagger (1)
 
Introduction to trader bots with Python
Introduction to trader bots with PythonIntroduction to trader bots with Python
Introduction to trader bots with Python
 
Customer Automation Masterclass - Workshop 1: Data Enrichment using Clearbit
Customer Automation Masterclass - Workshop 1: Data Enrichment using ClearbitCustomer Automation Masterclass - Workshop 1: Data Enrichment using Clearbit
Customer Automation Masterclass - Workshop 1: Data Enrichment using Clearbit
 

Último

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Best ways to use the ShareASale API

  • 1. Best Ways to Use the API ShareASale Think Tank 2013 Eric Nagel eric@ericnagel.com
  • 2. What is the ShareASale API? ● API = Application Programming Interface ○ An application programming interface (API) specifies how some software components should interact with each other. ○ It’s a way for your website to talk directly to the ShareASale system ● Affiliate API ● Merchant API
  • 3. Where to find the ShareASale API Affiliate API Under Tools Merchant API Under Tools
  • 4. Affiliate API: Authentication The Authentication Hash Authentication Hash : SHA-256 Hash in 64 character Hex format of the string "YourAPIToken:CurrentDateInUTCFormat: APIActionValue:YourAPISecret" (without quotes) For example, for following values: Token: NGc6dg5e9URups5o API Secret: ATj7vd8b7CCjeq9yQUo8cc2w3OThqe2e String to Hash: NGc6dg5e9URups5o:Thu, 14 Apr 2011 22:44:22 GMT:bannerList:ATj7vd8b7CCjeq9yQUo8cc2w3OThqe2e UTC Date: Thu, 14 Apr 2011 22:44:22 GMT API Action: bannerList The correct HTTP Headers would be: x-ShareASale-Date: Thu, 14 Apr 2011 22:44:22 GMT x-ShareASale-Authentication: 78D54A3051AE0AAAF022AA2DA230B97D5219D82183FEFF71E2D53DEC6057D9F1
  • 5. Affiliate API: Authentication IP Restrictions Start > Run cmd ping domain.com Gives you the IP These are the IPs that will be accessing the data. Since the script will reside on your server, use your server’s IP.
  • 6. Affiliate API: Authentication HUH???? Don’t worry. 1. Click “View Sample code in PHP” 2. Copy 3. Paste 4. Change values
  • 7. Affiliate API: Sample <?php $myAffiliateID = ''; Get these values from the API page $APIToken = ""; $APISecretKey = ""; $myTimeStamp = gmdate(DATE_RFC1123); $APIVersion = 1.8; We’ll get to this $actionVerb = "activity"; $sig = $APIToken.':'.$myTimeStamp.':'.$actionVerb.':'.$APISecretKey; $sigHash = hash("sha256",$sig); $myHeaders = array("x-ShareASale-Date: $myTimeStamp","x-ShareASale-Authentication: $sigHash");
  • 8. Affiliate API: Sample $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://shareasale.com/x.cfm? affiliateId=$myAffiliateID&token=$APIToken&version=$APIVersion&action=$actionVerb"); curl_setopt($ch, CURLOPT_HTTPHEADER,$myHeaders); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, 0); $returnResult = curl_exec($ch); Nothing to do here.
  • 9. Affiliate API: Sample if ($returnResult) { //parse HTTP Body to determine result of request if (stripos($returnResult,"Error Code ")) { // error occurred trigger_error($returnResult,E_USER_ERROR); } else{ // success echo $returnResult; } This is where you take over and put in your custom coding to do whatever you want with the data. } else{ // connection error trigger_error(curl_error($ch),E_USER_ERROR); }
  • 10. Affiliate API ● ● ● ● ● ● ● ● ● ● Activity Details Activity Summary Merchant Timespan Report Today's Stats Monthly Summary Void Trail Traffic API Token Count Get Products Invalid Links ● ● ● ● ● ● ● ● ● ● Datafeed Merchants Coupon/Deal Merchants Merchant Status Merchant Creatives Merchant Gift Cards Edit Trail Payment Summary Merchant Search Merchant Search by Product Ledger Report
  • 11. Example Use Activity Details to download transaction data daily and store in your tracking system or email you your commissions. Trans ID|User ID|Merchant ID|Trans Date|Trans Amount|Commission|Comment|Voided|Pendin g Date|Locked|Aff Comment|Banner Page|Reversal Date|Click Date|Click Time|Banner Id 37697968|132296|8723|10/16/2012 11:41:05 AM|323.7|71.21|Sale - 620946||||WCG45500|http://www.wineclubreviewsandratings. com/cellars-wine-club/sparkling-champagneclub-review||2012-10-16 00:00:00.0|11:34:11 AM|43027
  • 12. Example Use Coupon / Deal Merchants to download coupons to show on your website Deal Id|Merchant Id|Merchant|Start Date|End Date|Publish Date|Title|Image(big)|Tracking URL|Image(small) |Category|Description|Restrictions|Keywords|C oupon Code|Edit Date 12104|8684|Checks Unlimited|2009-06-15 00: 00:00.0|2050-12-31 00:00:00.0|2008-08-23 18: 09:10.0|Personal checks, additional 10% off reorder check pricing.|http://|http://www. shareasale.com/u.cfm? d=12104&m=8684&u=132296|http://||Personal checks only - additional 10% off reorder check pricing default online.|||PJKA|2009-06-18 12: 26:34.0
  • 13. Other Affiliate API Uses ● Get Products ○ Search by keyword to return products for a datafeed site ● Invalid Links ○ Make sure you’re not wasting your traffic ● Merchant Status ○ Be alerted when merchants go offline ● Merchant Creatives ○ Get the latest banners from merchants who run seasonal offers
  • 14. What Do I Do Now? ● Process the data ○ ○ ○ See fgetcsv(), split(), explode() Save to database Send an email ● Automate your script ○ Set up a “cron” to have the script run on a regular basis ● More help? ○ ○ http://www.ericnagel.com/how-to-tips/shareasale-api.html ■ 4 years old, but it still works. http://www.ericnagel.com/how-to-tips/shareasale-prosper202.html ■ If you use Prosper202
  • 15. Tips ● You have limited API calls. Use them wisely. ○ 200 / month = less than 7 per day i. ii. iii. iv. v. vi. Activity Details Traffic Get Products Invalid Links Coupon / Deal Merchants Merchant Status
  • 16. Tips ● While you’re writing your script to process the data, download the data once, then use the local file for processing. This way, only 1 API call will be used. ○ $cURL = 'https://shareasale.com/x.cfm? action=couponDeals&affiliateId=132296&token=az7bFTu3LwioXNRA &XMLFormat=0'; // $cURL = 'sas.csv'; $fp = fopen($cURL, "r");
  • 17. Tips Since we’re talking about APIs, why not combine a merchant’s direct API with the ShareASale API? ● Get data from merchant’s own API ● Change links to ShareASale Deeplinks ● … ● Profit http://www.wyzant.com/AffiliateProgram/
  • 18. Resources ● http://blog.shareasale.com/author/ryan/ ○ Ryan Frey writes about using all the ShareASale techie things ● http://www.ericnagel.com/tag/shareasale ○ I have a few blog posts about ShareASale - keep digging ● http://www.programmableweb.com/api/shareasale-affiliate ○ Programmable Web is all things API
  • 19. Questions? Eric Nagel Email: eric@ericnagel.com Website: www.ericnagel.com Twitter: @ericnagel