Socket
Socket
Sign inDemoInstall

cake-affiliate-api

Package Overview
Dependencies
54
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cake-affiliate-api

Cake Affiliate API for Node.js


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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) {
    // handle error...
  }
  else {
    handleData(data)
  }
}

API

Keep in mind that every API option which is passed in camelcase is underscored before making HTTP call. So it's OK to name options like mediaTypeCategoryId (converted to media_type_category_id).

getCampaign(campaignId, callback)

getCreativeCode(campaignId, creativeId, callback)

getCreativeTypes(callback)

getFeaturedOffer(callback)

getMediaTypeCategories(callback)

getOfferStatuses(callback)

getPixelTokens(callback)

getSubAffiliates(query, callback)

query options:

  • startAtRow defaults to 1
  • rowLimit defaults to 0

getSupressionList(offerId, callback)

getTags(callback)

getVerticalCategories(callback)

getVerticals(callback)

offerFeed(query, callback)

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

  • apiKey defaults to null

  • affiliateId defaults to null

    • Affiliate Id. Read documentation above.
  • baseUrl defaults to null

    • API endpoint of CAKE-based network.
  • rawResponse defaults false

    • If true xml2js is not called for XML response and it's returned as string.

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..?

Keywords

FAQs

Last updated on 04 Jul 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc