1.0.11 • Published 9 years ago

bonusly-client v1.0.11

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

What

A node client that consumes the Bonusly API to (currently support) retrieve/send bonuses

Quick Reference

Installation

  npm i --save bonusly-client

Use it

var BonuslyClient = require('bonusly-client'),
    client = new BonuslyClient('Your Access Token');

Retrive bonuses:

To retrieve all the bonuses, you simply call the getBonuses method with callback:

client.getBonuses(function(error, results) {
    if (error) {
      console.log('some error occurs: ', error);
    }
    console.log('The list of bonuses are', results);
});

Retrieve a specific bonus

To get a specific bonus detail call the getBonus function with the bonusID:

API

client.getBonus(bonusId, callback);

Example:

client.getBonus('55a3555f6c8277476500000c', function(error, result){
    ...
});

Give Bonus to someone

API:

client.giveBonus(receiverEmail, reason, amount, callback);

To create a bonus for someone, you would need to pass the receiverEmail, reason and the amount of the bonus:

Example:

client.giveBounus('bob.smith@majigger.com', 'Because bob is awesome', 20, function(error, result){
  if (error) {
    console.log('oops could not send bonus to bob, error is: ', error);
  }
  console.log('Successfully give 20 bounuses points to Bob because he is awesome! ', result);
});

Test

npm test
1.0.11

9 years ago

1.0.10

9 years ago

1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago