• Home
  • About
  • Best Practices
  • Webinars
  • Resources

ShareASale Blog

  • Twitter
  • Facebook
  • Pinterest
  • Google+
  • LinkedIn
  • ShareASale
  • Industry Insights
  • News & Events
    • Product Updates
  • Merchant Insights
    • Merchant training
  • Affiliate Insights
    • Affiliate training

Affiliate API Building Blocks

July 23, 2013 by ShareASale 1 Comment

Many Affiliates could benefit from the ShareASale API’s powerful tools. The API can answer a number of different questions, the most popular being:

  • Who are your best Merchants?

  • What are the new banners, deals, and products among them?

  • Do you have any links that are invalid and should be fixed?

You can use the API to have all that information delivered auto-magically!

Since it’s naturally technical, let’s go through the steps to using an API request.

Step 1 (with more detail): What do you want to do?

Pick what task you’d like to perform on ShareASale. Do you need a report of your daily stats in real-time? Try out the Today’s Stats report. For a broader view, the Monthly Summary will reveal your highest grossing commissions among Merchants in a period.

Are you looking to find Merchants who have products based on a certain keyword? The Merchant Search by Product API is perfect for the job (more: here).

Finally, if a big holiday is coming up you could grab all the new banners without having to ever login with the Merchant Creatives API request.

All API requests are basically a URL – you might be familiar with something similar when navigating the web.

Ryan Frey

Step 2 (with more detail): Requirements – Create the URL Request

All API requests are basically a URL – you might be familiar with something similar when navigating the web. When you type in the URL ‘www.facebook.com’ you’re requesting information from Facebook. For the ShareASale Affiliate API your URL is ‘https://shareasale.com/x.cfm’ instead.

However, with an API request instead of the browser receiving a web page for a human, it’s a script receiving data for a computer. Let’s first create the URL:

Start with: https://shareasale.com/x.cfm

All requests must contain:

  • ?affiliateID= your Affiliate ID number
  • &token= unique alphanumeric token received when account is set up for API use. Check your settings for yours.
  • &action= one of the supported actions (dailyActivity, monthlySummary, etc. from step 1 above)
  • &version= currently 1.7

Step 3 (with more detail): An Example

Working through a Today’s Stats transaction API request, we have the following so far:

https://shareasale.com/x.cfm?affiliateId=YourAffiliateID&token=abcDE1&action=dailyActivity&version=1.7

Hold on! You can include more than just those API parameters. A Today’s Stats API request also can include these:

  • &sortcol= the column you would like the data returned ordered, default on commissions
  • &sortdir= ASC for ascending, DESC for descending sort direction
  • &XMLFormat=0 for delimited, 1 for XML format data

To pull Today’s Stats in XML format sorted by hits descendingly, here’s what we’d create:

https://shareasale.com/x.cfm?affiliateId=YourAffiliateID&token=abcDE1&action=dailyActivity&version=1.7&sortcol=hits&sortdir=desc&XMLFormat=1

Step 4: Final Touch 

ShareASale’s API also requires you prove you really are the correct Affiliate. You wouldn’t want just anyone to be able to retrieve your commission info or determine your best converting Merchants! 

So, every request requires authentication. You can set only certain IP addresses to gain access, and/or send a special encoded authentication string with your request depending on the API version.

This is a bit technical, so read more on our Affiliate API settings page (Tools >> Affiliate API) including sample code to get you started. Once the authentication is setup, no more work is necessary.

 

Filed Under: Affiliates Tagged With: #BuildingBlocks, api

ShareASale

ShareASale

Comments

  1. Liz says

    August 24, 2013 at 10:24 pm

    Thanks for doing this post. I want to try and build a custom widget to show my current sales on my Cyfe dashboard. This article is a good start.

    Reply

Leave A Comment Cancel reply

Interested in hearing more from ShareASale?

To receive our latest news and email communications, please opt-in to our newsletter below.
* = required field
Tell us about you:



Events Calendar

«June 2023»
SunMonTuesWedThuFriSat
    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 

Merchant Discovery

Tags

#BestOf #BuildingBlocks #HowTo #LessonsLearned #Q4Prep #TheInterface affiliate affiliate resources affiliate summit affiliate timesavers affiliate tips around the office bfcm2016 black friday blogger tips blogging Brian Littleton client services conferences conference tips content tips cyber monday Featured fun friday general news gift guide gift guides gift guides 2016 interface merchant features merchant focus merchant programs merchant resources merchants merchant timesavers merchant tips month of the interface must have merchants new and notable new merchants product datafeeds q4 reports technology tip of the day

USEFUL LINKS

  • Industry Insights
  • Affiliates Insights
  • Merchants Insights
  • News & Events

RESOURCES

  • About Us
  • Contact Us
  • Resources
  • Best Practices
  • Webinars

Contact Us

SHAREASALE@SHAREASALE.COM
(312) 321-0487

  • Twitter
  • Facebook
  • Pinterest
  • Google+
  • LinkedIn
  • ShareASale