SDKs

We recommend using a SDK to send data to Databox’s Push API. We maintain SDKs for some of the more popular coding languages, listed below.

Databox Java SDKDatabox PHP SDKDatabox Ruby SDK
Databox Node.js SDKDatabox GO SDKDatabox Python SDK

  • PHP
  • JavaScript
  • Ruby
  • Java
  • Go
  • Python
use Databox\Client;

$c = new Client('<your_token>');

$ok = $c->push('sales', 123000);
var Databox = require('databox');

var client = new Databox({
    push_token: '<your_token>'
});

client.push({
    key: 'sales',
    value: 123000
}, function(response){
    console.log(response);
});
Databox.configure do |c|
  c.push_token = '<your_token>'
end

client = Databox::Client.new

client.push(key: 'sales', value: 123000)
String TOKEN = "<your_token>";
Databox databox = new Databox(TOKEN);
try {
  databox.push("sales", 123000d);
} catch (Exception e) {
  System.err.println(e.getLocalizedMessage());
}
package main

import (
    databox "github.com/databox/databox-go"
    "fmt"
)

func main() {
    client := databox.NewClient("<your_token>")

    if _, error := client.Push(&databox.KPI{
        Key:    "sales",
        Value:  123000,
    }); error != nil {
        fmt.Println("Inserted.")
    }
}
from databox import Client

client = Client('<your_token>')
client.push('sales', 123000)

  • PHP
  • JavaScript
  • Ruby
  • Java
  • Go
  • Python
use Databox\Client;

$c = new Client('<your_token>');

$c->insertAll([
    ['sales', 83000, '2018-01-19', [
      'channel' => 'online'
    ]],
    ['sales', 4000, '2018-01-20 16:07:37-06:00', [
      'channel' => 'retail'
    ]],
]);
var Databox = require('databox');

var client = new Databox({
    push_token: '<your_token>'
});

client.insertAll([
  {
    key: 'sales',
    value: 83000,
    date: '2018-01-19',
    attributes: {
      'channel': 'online'
    }
  },
  {
    key: 'sales',
    value: 4000,
    date: '2018-01-20 16:07:37-06:00',
    attributes: {
      'channel': 'retail'
    }
  }
]);
Databox.configure do |c|
  c.push_token = '<your_token>'
end

client = Databox::Client.new

client.insert_all [
    {key: 'sales', value: 83000, date: '2018-01-19', attributes: {
      channel: 'online'
    }},
    {key: 'sales', value: 4000, date: '2018-01-20 16:07:37-06:00', attributes: {
      channel: 'retail'
    }}
]
String TOKEN = "<your_token>";
Databox databox = new Databox(TOKEN);
try {
    List<Databox.KPI> kpis = new ArrayList<Databox.KPI>();
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
    kpis.add(new Databox.KPI().setKey("sales").setValue(83000).setDate(sdf.parse("2018-01-19")).addAttribute("channel", "online"));
    kpis.add(new Databox.KPI().setKey("sales").setValue(4000).setDate(sdf.parse("2018-01-20 16:07:37-06:00")).addAttribute("channel", "retail"));
    databox.push(kpis);
} catch (Exception e) {
    System.err.println(e.getLocalizedMessage());
}
package main

import (
    databox "github.com/databox/databox-go"
    "fmt"
)

func main() {
    client := databox.NewClient("<your_token>")

    var attributes = make(map[string]interface{})
    attributes["channel"] = "online"

    if _, error := client.Push(&databox.KPI{
        Key: "sales",
        Value: 83000,
        Date: time.Now().Format(time.RFC3339),
        Attributes: attributes,
    }); error != nil {
        fmt.Println("Inserted.")
    }
}
from databox import Client

client = Client('<your_token>')
client.insert_all([
    {'key': 'sales', 'value': 83000, 'date': '2018-01-19', 'attributes': {
      'channel': 'online',
    }},
    {'key': 'sales', 'value': 4000, 'date': '2018-01-20 16:07:37-06:00', 'attributes': {
      'channel': 'retail',
    }},
])

More examples
SQL to Databox (Ruby)
SQL to Databox (Python)

Contributions
We welcome your contributions! Feel free to fork and improve our SDKs. If you want your own SDK added to our list, please contact us.