Build Status

Badgeville API

Client for Badgeville API http://rules.badgeville.com/

Usage

First, checkout the examples folder. TL;DR:

  • create connection object with your api_key, and secret.
require 'badgeville'
settings = JSON.parse(File.read('keys.json.example'))
badgeville = Badgeville::Client.new(email, settings)
  • register user and player on site
badgeville.create_player
  • get player id
badgeville.player_info
  • log actions
badgeville.log_activity "commented"
  • get all logged activities
badgeville.get_activities
  • get list of reward definitions
badgeville.reward_definitions
  • manually award some reward
badgeville.award "Best User"

Installing

1) add to your Gemfile

gem 'badgeville'

2) Create a keys.json file with your api_key and secret (see keys.json.example file)