CAKE Affiliate API for Node.js
CAKE is SaaS platform providing marketing intelligence for perforfmance marketers (LinkedIn). These guys have many
different APIs thus they provide big marketing platform. This module covers Affiliate APIs group.
Requirements
- CoffeeScript installed globally (for
cake build
)
Installation
npm install cake-affiliate-api --save
Example
'use strict'
var CakeAffiliateAPI = require('cake-affiliate-api')
, options
, client
options = {
"apiKey": "MY_API_KEY",
"affiliateId": "100500",
"baseUrl": "https://cake.coolnetwork.com",
"rawResponse": true
}
client = new CakeAffiliateAPI(options)
client.offerFeed({offerStatusId: 3}, handleResult)
function handleResult(err, data) {
if (err) {
}
else {
handleData(data)
}
}
API
Keep in mind that every API option which is passed in camelcase
is underscore
d before making HTTP call. So it's OK to name options like mediaTypeCategoryId
(converted to media_type_category_id
).
getCreativeCode(campaignId, creativeId, callback)
query
options:
startAtRow
defaults to 1
rowLimit
defaults to 0
query
options:
campaignName
defaults ''
mediaTypeCategoryId
defaults to 0
verticalCategoryId
defaults to 0
verticalId
defaults to 0
offerStatusId
defaults to 0
tagId
defaults to 0
startAtRow
defaults to 1
rowLimit
defaults to 0
Options
FAQ
Why module is writted on CoffeeScript but compiled to JavaScript after npm install
?
I really like CoffeeScript for fast module development but dislike when people do something like this:
require('coffee-script');
require('./module.coffee');
Why should we do this if in the end all is compiled to JavaScript? :wink:
TODO
- Implement ALL APIs
- Add options for custom XML parser
- Add options for
xml2js
..?