Bonusly

Bonuses

Bonuses Overview

{
  "id": "24abcdef1234567890abcdef",
String
  "created_at": "2015-10-28T21:26:50Z",
String (Date-time)
  "reason": "For signing up for the world's favorite microbonus™ solution! #problem-solving",
String
  "reason_html": "For signing up for the world&#39;s favorite microbonus™ solution! <a class=\"hashtag\" href=\"http://bonus.ly/company/hashtags/problem-solving\">#problem-solving</a>",
String
  "amount": 50,
Integer
  "amount_with_currency": "50 points",
String
  "value": "#problem-solving",
String
  "giver": {
  "giver": { ... }
Object
    "id": "24abcdef1234567890abcdef",
String
    "short_name": "Bill",
String
    "display_name": "Bill",
String
    "username": "blumbergh",
String
    "email": "blumbergh@initech56313d8f1ba2397878000004.com",
String (Email)
    "path": "/company/users/56313d971ba23978780000c6",
String
    "full_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "profile_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "first_name": "Bill",
String
    "last_name": "Lumbergh",
String
    "last_active_at": null,
String (Date-time)
    "external_unique_id": "foo",
String

Unique identifier from external service

    "budget_boost": 0,
Integer
    "user_mode": "normal",
String
    "country": "US",
String
    "time_zone": "America/New_York",
String
    "*custom_property_name*": "*custom_property_value*",
String

Use the form property_name=property_value

    "can_give": true,
Boolean
    "earning_balance": 80,
Integer

only returned to self or admins

    "earning_balance_with_currency": "80 points",
String

only returned to self or admins

    "lifetime_earnings": 80,
Integer

only returned to self or admins

    "lifetime_earnings_with_currency": "80 points",
String

only returned to self or admins

    "can_receive": true,
Boolean
    "giving_balance": 42,
Integer

only returned to self or admins

    "giving_balance_with_currency": "42 points",
String

only returned to self or admins

    "time_zone": "America/Los_Angeles",
String

only returned to self or admins

    "status": "archived"
String

Will return either 'archived' or 'active'.

  },
  "receiver": {
  "receiver": { ... }
Object
    "id": "24abcdef1234567890abcdef",
String
    "short_name": "Bill",
String
    "display_name": "Bill",
String
    "username": "blumbergh",
String
    "email": "blumbergh@initech56313d8f1ba2397878000004.com",
String (Email)
    "path": "/company/users/56313d971ba23978780000c6",
String
    "full_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "profile_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "first_name": "Bill",
String
    "last_name": "Lumbergh",
String
    "last_active_at": null,
String (Date-time)
    "external_unique_id": "foo",
String

Unique identifier from external service

    "budget_boost": 0,
Integer
    "user_mode": "normal",
String
    "country": "US",
String
    "time_zone": "America/New_York",
String
    "*custom_property_name*": "*custom_property_value*",
String

Use the form property_name=property_value

    "can_give": true,
Boolean
    "earning_balance": 80,
Integer

only returned to self or admins

    "earning_balance_with_currency": "80 points",
String

only returned to self or admins

    "lifetime_earnings": 80,
Integer

only returned to self or admins

    "lifetime_earnings_with_currency": "80 points",
String

only returned to self or admins

    "can_receive": true,
Boolean
    "giving_balance": 42,
Integer

only returned to self or admins

    "giving_balance_with_currency": "42 points",
String

only returned to self or admins

    "time_zone": "America/Los_Angeles",
String

only returned to self or admins

    "status": "archived"
String

Will return either 'archived' or 'active'.

  },
  "child_count": 42,
Integer
  child_bonuses: [
Array

Will include a bonus object for each child bonus. Will only be returned if include_children parameter is true.

    {
    { ... }
Object
    }
  ]
  "via": "web",
String

Service bonus was created by

  "family_amount": 42
Integer

The total value of a bonus and all comments

}

Index

Open in API Explorer
GET /bonuses

For an RSS response add .atom to the end of the URI - read more

Example Request

Format:
curl --request GET \
  --url 'https://bonus.ly/api/v1/bonuses?limit=42&skip=42&start_time=&giver_email=blumbergh%2540initech.com&user_email=blumbergh%2540initech.com&hashtag=%2523teamwork&end_time=&receiver_email=blumbergh%2540initech.com&include_children=true&*custom_user_properties*=foo&access_token=YOUR%20API%20KEY%20HERE' \
  --header 'accept: application/json'
require 'uri'
require 'net/http'

url = URI("https://bonus.ly/api/v1/bonuses?limit=42&skip=42&start_time=&giver_email=blumbergh%2540initech.com&user_email=blumbergh%2540initech.com&hashtag=%2523teamwork&end_time=&receiver_email=blumbergh%2540initech.com&include_children=true&*custom_user_properties*=foo&access_token=YOUR%20API%20KEY%20HERE")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "bonus.ly",
  "port": null,
  "path": "/api/v1/bonuses?limit=42&skip=42&start_time=&giver_email=blumbergh%2540initech.com&user_email=blumbergh%2540initech.com&hashtag=%2523teamwork&end_time=&receiver_email=blumbergh%2540initech.com&include_children=true&*custom_user_properties*=foo&access_token=YOUR%20API%20KEY%20HERE",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("bonus.ly")

headers = { 'accept': "application/json" }

conn.request("GET", "/api/v1/bonuses?limit=42&skip=42&start_time=&giver_email=blumbergh%2540initech.com&user_email=blumbergh%2540initech.com&hashtag=%2523teamwork&end_time=&receiver_email=blumbergh%2540initech.com&include_children=true&*custom_user_properties*=foo&access_token=YOUR%20API%20KEY%20HERE", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://bonus.ly/api/v1/bonuses?limit=42&skip=42&start_time=&giver_email=blumbergh%2540initech.com&user_email=blumbergh%2540initech.com&hashtag=%2523teamwork&end_time=&receiver_email=blumbergh%2540initech.com&include_children=true&*custom_user_properties*=foo&access_token=YOUR%20API%20KEY%20HERE",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://bonus.ly/api/v1/bonuses?limit=42&skip=42&start_time=&giver_email=blumbergh%2540initech.com&user_email=blumbergh%2540initech.com&hashtag=%2523teamwork&end_time=&receiver_email=blumbergh%2540initech.com&include_children=true&*custom_user_properties*=foo&access_token=YOUR%20API%20KEY%20HERE"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("accept", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Query Parameters

Name Type Required Description Example
limit Integer Optional

min: 1, max: 500

42
skip Integer Optional

min: 0

42
start_time String (date-time) Optional
giver_email String (email) Optional blumbergh%40initech.com
user_email String (email) Optional blumbergh%40initech.com
hashtag String Optional %23teamwork
end_time String (date-time) Optional
receiver_email String (email) Optional blumbergh%40initech.com
include_children Boolean Optional true
*custom_user_properties* String Optional

Use the form property_name=property_value

foo

Responses

200 Success Bonuses Bonuses
[
  "id": "24abcdef1234567890abcdef",
String
  "created_at": "2015-10-28T21:26:50Z",
String (Date-time)
  "reason": "For signing up for the world's favorite microbonus™ solution! #problem-solving",
String
  "reason_html": "For signing up for the world&#39;s favorite microbonus™ solution! <a class=\"hashtag\" href=\"http://bonus.ly/company/hashtags/problem-solving\">#problem-solving</a>",
String
  "amount": 50,
Integer
  "amount_with_currency": "50 points",
String
  "value": "#problem-solving",
String
  "giver": {
  "giver": { ... }
Object
    "id": "24abcdef1234567890abcdef",
String
    "short_name": "Bill",
String
    "display_name": "Bill",
String
    "username": "blumbergh",
String
    "email": "blumbergh@initech56313d8f1ba2397878000004.com",
String (Email)
    "path": "/company/users/56313d971ba23978780000c6",
String
    "full_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "profile_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "first_name": "Bill",
String
    "last_name": "Lumbergh",
String
    "last_active_at": null,
String (Date-time)
    "external_unique_id": "foo",
String

Unique identifier from external service

    "budget_boost": 0,
Integer
    "user_mode": "normal",
String
    "country": "US",
String
    "time_zone": "America/New_York",
String
    "*custom_property_name*": "*custom_property_value*",
String

Use the form property_name=property_value

    "can_give": true,
Boolean
    "earning_balance": 80,
Integer

only returned to self or admins

    "earning_balance_with_currency": "80 points",
String

only returned to self or admins

    "lifetime_earnings": 80,
Integer

only returned to self or admins

    "lifetime_earnings_with_currency": "80 points",
String

only returned to self or admins

    "can_receive": true,
Boolean
    "giving_balance": 42,
Integer

only returned to self or admins

    "giving_balance_with_currency": "42 points",
String

only returned to self or admins

    "time_zone": "America/Los_Angeles",
String

only returned to self or admins

    "status": "archived"
String

Will return either 'archived' or 'active'.

  },
  "receiver": {
  "receiver": { ... }
Object
    "id": "24abcdef1234567890abcdef",
String
    "short_name": "Bill",
String
    "display_name": "Bill",
String
    "username": "blumbergh",
String
    "email": "blumbergh@initech56313d8f1ba2397878000004.com",
String (Email)
    "path": "/company/users/56313d971ba23978780000c6",
String
    "full_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "profile_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "first_name": "Bill",
String
    "last_name": "Lumbergh",
String
    "last_active_at": null,
String (Date-time)
    "external_unique_id": "foo",
String

Unique identifier from external service

    "budget_boost": 0,
Integer
    "user_mode": "normal",
String
    "country": "US",
String
    "time_zone": "America/New_York",
String
    "*custom_property_name*": "*custom_property_value*",
String

Use the form property_name=property_value

    "can_give": true,
Boolean
    "earning_balance": 80,
Integer

only returned to self or admins

    "earning_balance_with_currency": "80 points",
String

only returned to self or admins

    "lifetime_earnings": 80,
Integer

only returned to self or admins

    "lifetime_earnings_with_currency": "80 points",
String

only returned to self or admins

    "can_receive": true,
Boolean
    "giving_balance": 42,
Integer

only returned to self or admins

    "giving_balance_with_currency": "42 points",
String

only returned to self or admins

    "time_zone": "America/Los_Angeles",
String

only returned to self or admins

    "status": "archived"
String

Will return either 'archived' or 'active'.

  },
  "child_count": 42,
Integer
  child_bonuses: [
Array

Will include a bonus object for each child bonus. Will only be returned if include_children parameter is true.

    {
    { ... }
Object
    }
  ]
  "via": "web",
String

Service bonus was created by

  "family_amount": 42
Integer

The total value of a bonus and all comments

]
400 Errors Errors 400 - errors
{
  "message": "foo"
String
}
400 Out of range Errors 400 - out of range
{
  "message": "Sorry, *min* ≤ *value* ≤ *max*"
String
}

Show

Open in API Explorer
GET /bonuses/:id

Example Request

Format:
curl --request GET \
  --url 'https://bonus.ly/api/v1/bonuses/:id?access_token=YOUR%20API%20KEY%20HERE' \
  --header 'accept: application/json'
require 'uri'
require 'net/http'

url = URI("https://bonus.ly/api/v1/bonuses/:id?access_token=YOUR%20API%20KEY%20HERE")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "bonus.ly",
  "port": null,
  "path": "/api/v1/bonuses/:id?access_token=YOUR%20API%20KEY%20HERE",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("bonus.ly")

headers = { 'accept': "application/json" }

conn.request("GET", "/api/v1/bonuses/:id?access_token=YOUR%20API%20KEY%20HERE", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://bonus.ly/api/v1/bonuses/:id?access_token=YOUR%20API%20KEY%20HERE",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://bonus.ly/api/v1/bonuses/:id?access_token=YOUR%20API%20KEY%20HERE"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("accept", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Path Parameters

Name Type Required Description Example
id String Required 24abcdef1234567890abcdef

Responses

200 Success Bonuses Bonus
{
  "id": "24abcdef1234567890abcdef",
String
  "created_at": "2015-10-28T21:26:50Z",
String (Date-time)
  "reason": "For signing up for the world's favorite microbonus™ solution! #problem-solving",
String
  "reason_html": "For signing up for the world&#39;s favorite microbonus™ solution! <a class=\"hashtag\" href=\"http://bonus.ly/company/hashtags/problem-solving\">#problem-solving</a>",
String
  "amount": 50,
Integer
  "amount_with_currency": "50 points",
String
  "value": "#problem-solving",
String
  "giver": {
  "giver": { ... }
Object
    "id": "24abcdef1234567890abcdef",
String
    "short_name": "Bill",
String
    "display_name": "Bill",
String
    "username": "blumbergh",
String
    "email": "blumbergh@initech56313d8f1ba2397878000004.com",
String (Email)
    "path": "/company/users/56313d971ba23978780000c6",
String
    "full_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "profile_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "first_name": "Bill",
String
    "last_name": "Lumbergh",
String
    "last_active_at": null,
String (Date-time)
    "external_unique_id": "foo",
String

Unique identifier from external service

    "budget_boost": 0,
Integer
    "user_mode": "normal",
String
    "country": "US",
String
    "time_zone": "America/New_York",
String
    "*custom_property_name*": "*custom_property_value*",
String

Use the form property_name=property_value

    "can_give": true,
Boolean
    "earning_balance": 80,
Integer

only returned to self or admins

    "earning_balance_with_currency": "80 points",
String

only returned to self or admins

    "lifetime_earnings": 80,
Integer

only returned to self or admins

    "lifetime_earnings_with_currency": "80 points",
String

only returned to self or admins

    "can_receive": true,
Boolean
    "giving_balance": 42,
Integer

only returned to self or admins

    "giving_balance_with_currency": "42 points",
String

only returned to self or admins

    "time_zone": "America/Los_Angeles",
String

only returned to self or admins

    "status": "archived"
String

Will return either 'archived' or 'active'.

  },
  "receiver": {
  "receiver": { ... }
Object
    "id": "24abcdef1234567890abcdef",
String
    "short_name": "Bill",
String
    "display_name": "Bill",
String
    "username": "blumbergh",
String
    "email": "blumbergh@initech56313d8f1ba2397878000004.com",
String (Email)
    "path": "/company/users/56313d971ba23978780000c6",
String
    "full_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "profile_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "first_name": "Bill",
String
    "last_name": "Lumbergh",
String
    "last_active_at": null,
String (Date-time)
    "external_unique_id": "foo",
String

Unique identifier from external service

    "budget_boost": 0,
Integer
    "user_mode": "normal",
String
    "country": "US",
String
    "time_zone": "America/New_York",
String
    "*custom_property_name*": "*custom_property_value*",
String

Use the form property_name=property_value

    "can_give": true,
Boolean
    "earning_balance": 80,
Integer

only returned to self or admins

    "earning_balance_with_currency": "80 points",
String

only returned to self or admins

    "lifetime_earnings": 80,
Integer

only returned to self or admins

    "lifetime_earnings_with_currency": "80 points",
String

only returned to self or admins

    "can_receive": true,
Boolean
    "giving_balance": 42,
Integer

only returned to self or admins

    "giving_balance_with_currency": "42 points",
String

only returned to self or admins

    "time_zone": "America/Los_Angeles",
String

only returned to self or admins

    "status": "archived"
String

Will return either 'archived' or 'active'.

  },
  "child_count": 42,
Integer
  child_bonuses: [
Array

Will include a bonus object for each child bonus. Will only be returned if include_children parameter is true.

    {
    { ... }
Object
    }
  ]
  "via": "web",
String

Service bonus was created by

  "family_amount": 42
Integer

The total value of a bonus and all comments

}
404 Not found Errors 404 - not found
{
  "message": "*object* not found"
String
}

Create

Open in API Explorer
POST /bonuses

Structure of a Bonus Reason: Amount is set with a + Receivers are set with @ Hashtags are set with # Users can be notified with &

Ex: '+10 @george and @john for #excellence with that customer, check out the email chain &lucy #service'

Example Request

Format:
curl --request POST \
  --url 'https://bonus.ly/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"giver_email":"blumbergh@initech.com","reason":"+10 @george and @john for #excellence with that customer, check out the email chain &lucy #service","parent_bonus_id":"24abcdef1234567890abcdef"}'
require 'uri'
require 'net/http'

url = URI("https://bonus.ly/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["content-type"] = 'application/json'
request.body = "{\"giver_email\":\"blumbergh@initech.com\",\"reason\":\"+10 @george and @john for #excellence with that customer, check out the email chain &lucy #service\",\"parent_bonus_id\":\"24abcdef1234567890abcdef\"}"

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "bonus.ly",
  "port": null,
  "path": "/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ giver_email: 'blumbergh@initech.com',
  reason: '+10 @george and @john for #excellence with that customer, check out the email chain &lucy #service',
  parent_bonus_id: '24abcdef1234567890abcdef' }));
req.end();
import http.client

conn = http.client.HTTPSConnection("bonus.ly")

payload = "{\"giver_email\":\"blumbergh@initech.com\",\"reason\":\"+10 @george and @john for #excellence with that customer, check out the email chain &lucy #service\",\"parent_bonus_id\":\"24abcdef1234567890abcdef\"}"

headers = {
    'accept': "application/json",
    'content-type': "application/json"
    }

conn.request("POST", "/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://bonus.ly/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"giver_email\":\"blumbergh@initech.com\",\"reason\":\"+10 @george and @john for #excellence with that customer, check out the email chain &lucy #service\",\"parent_bonus_id\":\"24abcdef1234567890abcdef\"}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://bonus.ly/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE"

	payload := strings.NewReader("{\"giver_email\":\"blumbergh@initech.com\",\"reason\":\"+10 @george and @john for #excellence with that customer, check out the email chain &lucy #service\",\"parent_bonus_id\":\"24abcdef1234567890abcdef\"}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("accept", "application/json")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Request Body

Name Type Required Description Example
data Object Required
{
  "giver_email": "blumbergh@initech.com",
String (Email)

[ADMIN], optional

  "reason": "+10 @george and @john for #excellence with that customer, check out the email chain &lucy #service",
String

required

Structure of a Bonus Reason: Amount is set with a + Receivers are set with @ Hashtags are set with # Users can be notified with &

  "parent_bonus_id": "24abcdef1234567890abcdef"
String

optional, for creating comments

}

Responses

200 Success Bonuses Bonus
{
  "id": "24abcdef1234567890abcdef",
String
  "created_at": "2015-10-28T21:26:50Z",
String (Date-time)
  "reason": "For signing up for the world's favorite microbonus™ solution! #problem-solving",
String
  "reason_html": "For signing up for the world&#39;s favorite microbonus™ solution! <a class=\"hashtag\" href=\"http://bonus.ly/company/hashtags/problem-solving\">#problem-solving</a>",
String
  "amount": 50,
Integer
  "amount_with_currency": "50 points",
String
  "value": "#problem-solving",
String
  "giver": {
  "giver": { ... }
Object
    "id": "24abcdef1234567890abcdef",
String
    "short_name": "Bill",
String
    "display_name": "Bill",
String
    "username": "blumbergh",
String
    "email": "blumbergh@initech56313d8f1ba2397878000004.com",
String (Email)
    "path": "/company/users/56313d971ba23978780000c6",
String
    "full_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "profile_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "first_name": "Bill",
String
    "last_name": "Lumbergh",
String
    "last_active_at": null,
String (Date-time)
    "external_unique_id": "foo",
String

Unique identifier from external service

    "budget_boost": 0,
Integer
    "user_mode": "normal",
String
    "country": "US",
String
    "time_zone": "America/New_York",
String
    "*custom_property_name*": "*custom_property_value*",
String

Use the form property_name=property_value

    "can_give": true,
Boolean
    "earning_balance": 80,
Integer

only returned to self or admins

    "earning_balance_with_currency": "80 points",
String

only returned to self or admins

    "lifetime_earnings": 80,
Integer

only returned to self or admins

    "lifetime_earnings_with_currency": "80 points",
String

only returned to self or admins

    "can_receive": true,
Boolean
    "giving_balance": 42,
Integer

only returned to self or admins

    "giving_balance_with_currency": "42 points",
String

only returned to self or admins

    "time_zone": "America/Los_Angeles",
String

only returned to self or admins

    "status": "archived"
String

Will return either 'archived' or 'active'.

  },
  "receiver": {
  "receiver": { ... }
Object
    "id": "24abcdef1234567890abcdef",
String
    "short_name": "Bill",
String
    "display_name": "Bill",
String
    "username": "blumbergh",
String
    "email": "blumbergh@initech56313d8f1ba2397878000004.com",
String (Email)
    "path": "/company/users/56313d971ba23978780000c6",
String
    "full_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "profile_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "first_name": "Bill",
String
    "last_name": "Lumbergh",
String
    "last_active_at": null,
String (Date-time)
    "external_unique_id": "foo",
String

Unique identifier from external service

    "budget_boost": 0,
Integer
    "user_mode": "normal",
String
    "country": "US",
String
    "time_zone": "America/New_York",
String
    "*custom_property_name*": "*custom_property_value*",
String

Use the form property_name=property_value

    "can_give": true,
Boolean
    "earning_balance": 80,
Integer

only returned to self or admins

    "earning_balance_with_currency": "80 points",
String

only returned to self or admins

    "lifetime_earnings": 80,
Integer

only returned to self or admins

    "lifetime_earnings_with_currency": "80 points",
String

only returned to self or admins

    "can_receive": true,
Boolean
    "giving_balance": 42,
Integer

only returned to self or admins

    "giving_balance_with_currency": "42 points",
String

only returned to self or admins

    "time_zone": "America/Los_Angeles",
String

only returned to self or admins

    "status": "archived"
String

Will return either 'archived' or 'active'.

  },
  "child_count": 42,
Integer
  child_bonuses: [
Array

Will include a bonus object for each child bonus. Will only be returned if include_children parameter is true.

    {
    { ... }
Object
    }
  ]
  "via": "web",
String

Service bonus was created by

  "family_amount": 42
Integer

The total value of a bonus and all comments

}
400 Invalid params Errors 400 - invalid params
{
  "message": "Params *[params]* is/are invalid"
String
}
400 Errors Errors 400 - errors
{
  "message": "foo"
String
}
400 Ensure giver Errors 400 - ensure giver
{
  "message": "Must provide an API token associated with a user or specify giver email. Get one at https://bonus.ly/api"
String
}
403 Require company admin

to specify giver_email

Errors 403 - require company admin
{
  "message": "Must be company admin"
String
}

Update

Open in API Explorer
PUT /bonuses

Example Request

Format:
curl --request PUT \
  --url 'https://bonus.ly/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"reason":"+10 @george and @john for #excellence with that customer, check out the email chain &lucy #service"}'
require 'uri'
require 'net/http'

url = URI("https://bonus.ly/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["accept"] = 'application/json'
request["content-type"] = 'application/json'
request.body = "{\"reason\":\"+10 @george and @john for #excellence with that customer, check out the email chain &lucy #service\"}"

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "PUT",
  "hostname": "bonus.ly",
  "port": null,
  "path": "/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ reason: '+10 @george and @john for #excellence with that customer, check out the email chain &lucy #service' }));
req.end();
import http.client

conn = http.client.HTTPSConnection("bonus.ly")

payload = "{\"reason\":\"+10 @george and @john for #excellence with that customer, check out the email chain &lucy #service\"}"

headers = {
    'accept': "application/json",
    'content-type': "application/json"
    }

conn.request("PUT", "/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://bonus.ly/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "{\"reason\":\"+10 @george and @john for #excellence with that customer, check out the email chain &lucy #service\"}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://bonus.ly/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE"

	payload := strings.NewReader("{\"reason\":\"+10 @george and @john for #excellence with that customer, check out the email chain &lucy #service\"}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("accept", "application/json")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Path Parameters

Name Type Required Description Example
id String Required 24acbdef1234567890abcdef

Request Body

Name Type Required Description Example
data Object Optional
{
  "reason": "+10 @george and @john for #excellence with that customer, check out the email chain &lucy #service"
String

required

Structure of a Bonus Reason: Amount is set with a + Receivers are set with @ Hashtags are set with # Users can be notified with &

}

Responses

200 Success Bonuses Bonus
{
  "id": "24abcdef1234567890abcdef",
String
  "created_at": "2015-10-28T21:26:50Z",
String (Date-time)
  "reason": "For signing up for the world's favorite microbonus™ solution! #problem-solving",
String
  "reason_html": "For signing up for the world&#39;s favorite microbonus™ solution! <a class=\"hashtag\" href=\"http://bonus.ly/company/hashtags/problem-solving\">#problem-solving</a>",
String
  "amount": 50,
Integer
  "amount_with_currency": "50 points",
String
  "value": "#problem-solving",
String
  "giver": {
  "giver": { ... }
Object
    "id": "24abcdef1234567890abcdef",
String
    "short_name": "Bill",
String
    "display_name": "Bill",
String
    "username": "blumbergh",
String
    "email": "blumbergh@initech56313d8f1ba2397878000004.com",
String (Email)
    "path": "/company/users/56313d971ba23978780000c6",
String
    "full_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "profile_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "first_name": "Bill",
String
    "last_name": "Lumbergh",
String
    "last_active_at": null,
String (Date-time)
    "external_unique_id": "foo",
String

Unique identifier from external service

    "budget_boost": 0,
Integer
    "user_mode": "normal",
String
    "country": "US",
String
    "time_zone": "America/New_York",
String
    "*custom_property_name*": "*custom_property_value*",
String

Use the form property_name=property_value

    "can_give": true,
Boolean
    "earning_balance": 80,
Integer

only returned to self or admins

    "earning_balance_with_currency": "80 points",
String

only returned to self or admins

    "lifetime_earnings": 80,
Integer

only returned to self or admins

    "lifetime_earnings_with_currency": "80 points",
String

only returned to self or admins

    "can_receive": true,
Boolean
    "giving_balance": 42,
Integer

only returned to self or admins

    "giving_balance_with_currency": "42 points",
String

only returned to self or admins

    "time_zone": "America/Los_Angeles",
String

only returned to self or admins

    "status": "archived"
String

Will return either 'archived' or 'active'.

  },
  "receiver": {
  "receiver": { ... }
Object
    "id": "24abcdef1234567890abcdef",
String
    "short_name": "Bill",
String
    "display_name": "Bill",
String
    "username": "blumbergh",
String
    "email": "blumbergh@initech56313d8f1ba2397878000004.com",
String (Email)
    "path": "/company/users/56313d971ba23978780000c6",
String
    "full_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "profile_pic_url": "http://bonus.ly/avatar/blumbergh.png",
String (Url)
    "first_name": "Bill",
String
    "last_name": "Lumbergh",
String
    "last_active_at": null,
String (Date-time)
    "external_unique_id": "foo",
String

Unique identifier from external service

    "budget_boost": 0,
Integer
    "user_mode": "normal",
String
    "country": "US",
String
    "time_zone": "America/New_York",
String
    "*custom_property_name*": "*custom_property_value*",
String

Use the form property_name=property_value

    "can_give": true,
Boolean
    "earning_balance": 80,
Integer

only returned to self or admins

    "earning_balance_with_currency": "80 points",
String

only returned to self or admins

    "lifetime_earnings": 80,
Integer

only returned to self or admins

    "lifetime_earnings_with_currency": "80 points",
String

only returned to self or admins

    "can_receive": true,
Boolean
    "giving_balance": 42,
Integer

only returned to self or admins

    "giving_balance_with_currency": "42 points",
String

only returned to self or admins

    "time_zone": "America/Los_Angeles",
String

only returned to self or admins

    "status": "archived"
String

Will return either 'archived' or 'active'.

  },
  "child_count": 42,
Integer
  child_bonuses: [
Array

Will include a bonus object for each child bonus. Will only be returned if include_children parameter is true.

    {
    { ... }
Object
    }
  ]
  "via": "web",
String

Service bonus was created by

  "family_amount": 42
Integer

The total value of a bonus and all comments

}
400 Edit Window Errors 400 - edit window
{
  "message": "Bonuses are only updatable/deletable within 30 minutes of creation"
String
}
400 Errors Errors 400 - errors
{
  "message": "foo"
String
}
403 Permission Errors 403 - permission
{
  "message": "You do not have permission to update/delete this bonus"
String
}
404 Not Found Errors 404 - not found
{
  "message": "*object* not found"
String
}

Delete

Open in API Explorer
DELETE /bonuses

Example Request

Format:
curl --request DELETE \
  --url 'https://bonus.ly/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE' \
  --header 'accept: application/json'
require 'uri'
require 'net/http'

url = URI("https://bonus.ly/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "DELETE",
  "hostname": "bonus.ly",
  "port": null,
  "path": "/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("bonus.ly")

headers = { 'accept': "application/json" }

conn.request("DELETE", "/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://bonus.ly/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://bonus.ly/api/v1/bonuses?access_token=YOUR%20API%20KEY%20HERE"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("accept", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Path Parameters

Name Type Required Description Example
id String Required 24abcdef1234567890abcdef

Responses

200 Success Bonuses Bonus deleted
{
  "message": "Bonus Deleted"
String
}
400 Edit Window Errors 400 - edit window
{
  "message": "Bonuses are only updatable/deletable within 30 minutes of creation"
String
}
400 Failed to Delete Errors 400 - failed to delete
{
  "message": "Failed to delete *object*"
String
}
403 Permission Errors 403 - permission
{
  "message": "You do not have permission to update/delete this bonus"
String
}
404 Not Found Errors 404 - not found
{
  "message": "*object* not found"
String
}