1.0.0 • Published 4 years ago

firstpromoter-api-node v1.0.0

Weekly downloads
274
License
MIT
Repository
github
Last release
4 years ago

firstpromoter-api-node

travis ci

Node.js FirstPromoter API bindings. API docs available here: https://docs.firstpromoter.com/#api-reference

Installation

npm install --save firstpromoter-api-node

API

FirstpromoterApiNode(options)

Creates a new FirstpromoterApiNode instance.

Arguments

  • options - Optional - A plain JavaScript object that contains the configuration options.

Options

  • wid - Optional (String) - Integration ID(wid)
  • key - Required (Boolean) - API key

Return value

A FirstpromoterApiNode instance.

Example of POST request

const FirstpromoterApiNode = require('firstpromoter-api-node');

const firstpromoterApiNode = new FirstpromoterApiNode({
  key: 'YOUR_KEY',
  wid: 'YOUR_WID'
});

firstpromoterApiNode.post('track/signup', {
  email: 'example: email.com',
  tid: 'VISITOR_ID'
}).then(
  result => console.log(result),
  err => console.log(err)
);

Result

{
  "body": {
    "id": 12345,
    "type": "signup",
    "amount_cents": null,
    "reward": null,
    "lead": {},
    "promoter": {}
  }
}
1.0.0

4 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago