Bonusly

Companies

Companies Overview

{
  "id": "24abcdef1234567890abcdef",
String
  "name": "Initech",
String
  "custom_user_properties": [
    "department",
    "location"
  ],
Array
  "give_amounts": [
    10,
    20,
    30,
    40,
    50
  ],
Array
  "allow_redemptions": true,
Boolean
  catalog_countries: [
Array
    {
    { ... }
Object

Country

      "code": "US",
String
      "name": "United States",
String
      "flag_path": "/assets/flags/US.gif"
String
    }
  ]
  "valid_billing_information": true,
Boolean
  "show_bonus_information": true,
Boolean
  "budget": {
  "budget": { ... }
Object
    "id": "56313d8f1ba2397878000008",
String
    "singular": "point",
String
    "plural": "points",
String
    "format": {
    "format": { ... }
Object
      "singular": "[X] point",
String
      "plural": "[X] points"
String
    }
  },
  "company_hashtags": [
    "#teamwork",
    "#leadership",
    "#problem-solving",
    "#innovation",
    "#customer-service",
    "#vision"
  ],
Array
  "suggested_hashtags": [
    "#teamwork",
    "#leadership",
    "#problem-solving",
    "#innovation",
    "#customer-service",
    "#vision"
  ],
Array
  "popular_hashtags": [
    "#teamwork",
    "#leadership",
    "#problem-solving",
    "#innovation",
    "#customer-service",
    "#vision"
  ]
Array
}

Show

Open in API Explorer
GET /companies/show

Example Request

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

url = URI("https://bonus.ly/api/v1/companies/show?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/companies/show?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/companies/show?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/companies/show?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/companies/show?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))

}

Responses

200 Success Companies Company
{
  "id": "24abcdef1234567890abcdef",
String
  "name": "Initech",
String
  "custom_user_properties": [
    "department",
    "location"
  ],
Array
  "give_amounts": [
    10,
    20,
    30,
    40,
    50
  ],
Array
  "allow_redemptions": true,
Boolean
  catalog_countries: [
Array
    {
    { ... }
Object

Country

      "code": "US",
String
      "name": "United States",
String
      "flag_path": "/assets/flags/US.gif"
String
    }
  ]
  "valid_billing_information": true,
Boolean
  "show_bonus_information": true,
Boolean
  "budget": {
  "budget": { ... }
Object
    "id": "56313d8f1ba2397878000008",
String
    "singular": "point",
String
    "plural": "points",
String
    "format": {
    "format": { ... }
Object
      "singular": "[X] point",
String
      "plural": "[X] points"
String
    }
  },
  "company_hashtags": [
    "#teamwork",
    "#leadership",
    "#problem-solving",
    "#innovation",
    "#customer-service",
    "#vision"
  ],
Array
  "suggested_hashtags": [
    "#teamwork",
    "#leadership",
    "#problem-solving",
    "#innovation",
    "#customer-service",
    "#vision"
  ],
Array
  "popular_hashtags": [
    "#teamwork",
    "#leadership",
    "#problem-solving",
    "#innovation",
    "#customer-service",
    "#vision"
  ]
Array
}

[ADMIN] Update

Open in API Explorer
PUT /companies/update

Example Request

Format:
curl --request PUT \
  --url 'https://bonus.ly/api/v1/companies/update?access_token=YOUR%20API%20KEY%20HERE' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"name":"Initech","custom_user_properties":["department","location"]}'
require 'uri'
require 'net/http'

url = URI("https://bonus.ly/api/v1/companies/update?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 = "{\"name\":\"Initech\",\"custom_user_properties\":[\"department\",\"location\"]}"

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

var options = {
  "method": "PUT",
  "hostname": "bonus.ly",
  "port": null,
  "path": "/api/v1/companies/update?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({ name: 'Initech',
  custom_user_properties: [ 'department', 'location' ] }));
req.end();
import http.client

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

payload = "{\"name\":\"Initech\",\"custom_user_properties\":[\"department\",\"location\"]}"

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

conn.request("PUT", "/api/v1/companies/update?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/companies/update?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 => "{\"name\":\"Initech\",\"custom_user_properties\":[\"department\",\"location\"]}",
  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/companies/update?access_token=YOUR%20API%20KEY%20HERE"

	payload := strings.NewReader("{\"name\":\"Initech\",\"custom_user_properties\":[\"department\",\"location\"]}")

	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))

}

Request Body

Name Type Required Description Example
data Object Required
{
  "name": "Initech",
String
  "custom_user_properties": [
    "department",
    "location"
  ]
Array
}

Responses

200 Success Companies Company
{
  "id": "24abcdef1234567890abcdef",
String
  "name": "Initech",
String
  "custom_user_properties": [
    "department",
    "location"
  ],
Array
  "give_amounts": [
    10,
    20,
    30,
    40,
    50
  ],
Array
  "allow_redemptions": true,
Boolean
  catalog_countries: [
Array
    {
    { ... }
Object

Country

      "code": "US",
String
      "name": "United States",
String
      "flag_path": "/assets/flags/US.gif"
String
    }
  ]
  "valid_billing_information": true,
Boolean
  "show_bonus_information": true,
Boolean
  "budget": {
  "budget": { ... }
Object
    "id": "56313d8f1ba2397878000008",
String
    "singular": "point",
String
    "plural": "points",
String
    "format": {
    "format": { ... }
Object
      "singular": "[X] point",
String
      "plural": "[X] points"
String
    }
  },
  "company_hashtags": [
    "#teamwork",
    "#leadership",
    "#problem-solving",
    "#innovation",
    "#customer-service",
    "#vision"
  ],
Array
  "suggested_hashtags": [
    "#teamwork",
    "#leadership",
    "#problem-solving",
    "#innovation",
    "#customer-service",
    "#vision"
  ],
Array
  "popular_hashtags": [
    "#teamwork",
    "#leadership",
    "#problem-solving",
    "#innovation",
    "#customer-service",
    "#vision"
  ]
Array
}
400 Invalid params Errors 400 - invalid params
{
  "message": "Params *[params]* is/are invalid"
String
}
400 Error Errors 400 - errors
{
  "message": "foo"
String
}
403 Must be admin Errors 403 - require company admin
{
  "message": "Must be company admin"
String
}