Skip to content

Instantly share code, notes, and snippets.

@meglio
Created August 27, 2014 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meglio/9ea5a0c3acfcbf1a9dc6 to your computer and use it in GitHub Desktop.
Save meglio/9ea5a0c3acfcbf1a9dc6 to your computer and use it in GitHub Desktop.
API documentation example
# API ACCESS
* Access Point: http://affiliatex.com/api
* All fields must be passed in POST variables; GET variables will be ignored.
* You will have to retrieve a secret key in order to use AffiliateX API.
# API RESPONSE FORMAT
The response will be always JSON-encoded.
Failure example:
`{"message":"Incorrect API call hash","data":false}`
Success example:
`{"message":"OK","data":false}`
Response components:
* `message`: `OK` for success, an error message otherwise
* `data`: additional data if any, false otherwise
# USER AUTHORIZATION API
Allows to check if user credentials are correct (email and password)
URL: http://affiliatex.com/api/auth
Expected POST variables: email, pass, hash
* email: email of the user to check authorization for
* pass: pure (unhashed) value of the password
* hash: md5($email . '|' . $pass . '|' . $secretKey)
Example of POST variables:
email=x.meglio%40gmail.com&pass=...&hash=...
Success check example:
`{"message":"OK","data":false}`
Failure examples:
`{"message":"Incorrect user credentials","data":false}`
`{"message":"Incorrect API call hash","data":false}`
`{"message":"API call hash not specified","data":false}`
# CLICKBANK AFFILIATE PROGRAMS API
Returns 500 affiliate programs from:
http://affiliatex.com/clickbank_hot_100
... or the top 20 affiliate programs for a given niche.
URL: http://affiliatex.com/api/cb_aff_programs
Expected POST variables: apipass, hash, niche (optional)
- apipass: special api password string
- hash: md5($apipass . '|' . $secretKey)
- hash if niche specified: md5($apipass . '|' . $niche . '|' . $secretKey)
Example of successful response:
{
"message": "OK",
"data": [
{
"cbid":"VEGASBIZ",
"title":"My Vegas Business - Brand New Opportunity - Huge Epc's!!",
"gravity":"231.707",
"stars":"5",
"growth":"5",
"new_program":"0",
"afftitle":"My Vegas Business",
"headline":"FREE VIDEO: If you don't take advantage of tis NOW, you're going to really hate yourself later...",
"chrishot":"0",
"email_swipes":"3",
"jv_found":"1",
"niche_keyword":"make money",
"organic_rating":"1",
"ppc_rating":"1",
"jv_rating":"2",
"twitter_rating":"2",
"alexa_rank":"15805",
"pitch_domain_created":0,
"youtube_videos":[
],
"keywordsAlertsLink":"affiliateprograms\/My_Vegas_Business\/id39010",
"hoplink":"http:\/\/yourlinkx.VEGASBIZ.hop.clickbank.net",
"pitch_page_thumb_url":"http:\/\/affiliatex.com\/cb-thumb\/39010.png",
"banner_ads_url":[
],
"domain":"http:\/\/www.MyVegasBusiness.com\/live\/"
},
...
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment