Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Leftronic API Documentation
Python Ruby PHP JavaScript
Branch: master
Failed to load latest commit information.
node Updating Node readme
php Adding pushPair
python Adding Python readme
ruby Adding push_html, push_image, and push_pair
README.md Update main repo readme

README.md

Leftronic API Documentation

What is Leftronic?

Leftronic makes powerful dashboards for business intelligence.

  • Colorful and interactive data visualizations
  • Templates to get you started right away
  • Drag-and-drop editor makes it easy for anyone to create a powerful dashboard, customized to their needs
  • Integration with Google Analytics, Twitter, Chartbeat, Zendesk, Basecamp, Pivotal Tracker, Facebook, and more!
  • Dashboards can be protected or shared with a shortened URL
  • Powerful API's for PHP, Python, Ruby, and Node
  • Python Package and Ruby Gem
  • For full documentation see our API page

Technical Notes

All API requests are made by sending a POST request to https://www.leftronic.com/customSend with a properly formatted JSON packet. We do not support XML.

Getting Started

If you haven't already, create an account at https://www.leftronic.com/accounts/login.

PHP

Start by downloading the most recent version of our PHP API at (https://github.com/leftronic/leftronic/tree/master/php).

Dependencies

This API library uses "json_encode()" which requires PHP 5.2.0 or greater.

Create a class instance with your API key. Feel free to name it whatever you'd like.

$update = new Leftronic("YOUR_ACCESS_KEY");

Here are some example functions to push to your dashboard. Be sure you have configured the correct widgets to accept custom data points. Also, be sure that you have entered your API access key correctly.

Let's start with pushing a number to a widget.

$update->pushNumber("yourNumberStream", 14600);

Now we'll push some geographic coordinates to a map widget. You can use either the U.S. or world map widgets. The first coordinate (37.8) is the latitude and the second coordinate (-122.6) is the longitude. If your request is successful, you should see a data point appear on San Francisco, California. Optionally, if you'd like to set the color of your map point simply specify that in your function call. Note: only red, blue, green, purple, and yellow colors are supported at this time. Incorrect or missing color will default to red.

$update->pushGeo("yourGeoStream", 37.8, -122.6);
$update->pushGeo("yourGeoStream", 37.8, -122.6, "blue");

Here's how you push a title and message to a text feed widget.

$update->pushText("yourTextStream", "This is my title.", "Hello World!");

Let's push an array of names and values to a leaderboard widget. Be sure to create the array first (you may call it whatever you'd like). Be careful to use the proper syntax. Next, push the array to your widget.

$leaderArray = array(array("name" => "Johnny", "value" => 84), array("name" => "Jamie", "value" => 75), array("name" => "Lance", "value" => 62));

$update->pushLeaderboard("yourBoardStream", $leaderArray);

Similar to the last example, let's push a list of items to a list widget. Same rules as last time.

$listArray = array(array("listItem" => "Elizabeth"), array("listItem" => "Marshall"), array("listItem" => "Claire"), array("listItem" => "Nolan"));

$update->pushList("yourListStream", $listArray);

See our PHP API page for full documentation.

Python

Start by downloading the most recent version of our Python API at https://github.com/leftronic/leftronic/tree/master/python. You can also download a package on the Python Package Index or Github. You may also use pip to install the Leftronic package with pip install leftronic.

Import the file. Your location may vary.

from leftronic import Leftronic

Create a class instance with your API key. Feel free to name it whatever you'd like.

update = Leftronic("YOUR_ACCESS_KEY")

Here are some example functions to push to your dashboard. Be sure you have configured the correct widgets to accept custom data points. Also, be sure that you have entered your API access key correctly.

Let's start with pushing a number to a widget.

update.pushNumber("yourNumberStream", 14600)

Now we'll push some geographic coordinates to a map widget. You can use either the U.S. or world map widgets. The first coordinate (37.8) is the latitude and the second coordinate (-122.6) is the longitude. If your request is successful, you should see a data point appear on San Francisco, California. Optionally, if you'd like to set the color of your map point simply specify that in your function call. Note: only red, blue, green, purple, and yellow colors are supported at this time. Incorrect or missing color will default to red.

update.pushGeo("yourGeoStream", 37.8, -122.6)
update.pushGeo("yourGeoStream", 37.8, -122.6, "blue")

Here's how you push a title and message to a text feed widget.

update.pushText("yourTextStream", "This is my title.", "Hello World!")

Let's push an array of names and values to a leaderboard widget. Be sure to create the array first (you may call it whatever you'd like). Be careful to use the proper syntax. Next, push the array to your widget.

leaderArray = [{"name": "Johnny", "value": 84}, {"name": "Jamie", "value": 75}, {"name": "Lance", "value": 62}]

update.pushLeaderboard("yourBoardStream", leaderArray)

Similar to the last example, let's push a list of items to a list widget. Same rules as last time.

listArray = [{"listItem": "Elizabeth"}, {"listItem": "Marshall"}, {"listItem": "Claire"}, {"listItem": "Nolan"}]

update.pushList("yourListStream", listArray)

See our Python API page for full documentation.

Ruby

Start by downloading the most recent version of our Ruby API at https://github.com/leftronic/leftronic/tree/master/ruby/lib. You can also download a Gem file on the RubyGems or Github. You may also use gem to install the Leftronic package with gem install leftronicapi.

Dependencies

RubyGems, Curb, and JSON. We recommend installing them with the RubyGems installer.

require 'rubygems'
require 'curb'
require 'json'

Import the file. Your location may vary.

require 'leftronic'

Create a class instance with your API key. Feel free to name it whatever you'd like.

update = Leftronic.new("YOUR_ACCESS_KEY")

Here are some example functions to push to your dashboard. Be sure you have configured the correct widgets to accept custom data points. Also, be sure that you have entered your API access key correctly.

Let's start with pushing a number to a widget.

update = Leftronic.pushNumber("yourNumberStream", 14600)

Now we'll push some geographic coordinates to a map widget. You can use either the U.S. or world map widgets. The first coordinate (37.8) is the latitude and the second coordinate (-122.6) is the longitude. If your request is successful, you should see a data point appear on San Francisco, California. Optionally, if you'd like to set the color of your map point simply specify that in your function call. Note: only red, blue, green, purple, and yellow colors are supported at this time. Incorrect or missing color will default to red.

update = Leftronic.pushGeo("yourGeoStream", 37.8, -122.6)
update = Leftronic.pushGeo("yourGeoStream", 37.8, -122.6, "blue")

Here's how you push a title and message to a text feed widget.

update = Leftronic.pushText("yourTextStream", "This is my title.", "Hello World!")

Let's push an array of names and values to a leaderboard widget. Be sure to create the array first (you may call it whatever you'd like). Be careful to use the proper syntax. Next, push the array to your widget.

leaderArray = Array[{"name" => "Johnny", "value" => 84}, {"name" => "Jamie", "value" => 75}, {"name" => "Lance", "value" => 62}]

update = Leftronic.pushLeaderboard("yourBoardStream", leaderArray)

Similar to the last example, let's push a list of items to a list widget. Same rules as last time.

listArray = Array[{"listItem" => "Elizabeth"}, {"listItem" => "Marshall"}, {"listItem" => "Claire"}, {"listItem" => "Nolan"}]

update = Leftronic.pushList("yourListStream", listArray)

See our Ruby API page for full documentation.

Java

Our Java API was created by Webmetrics and is available at https://github.com/webmetrics/leftronic-java.

At this time we do not offer support for our Java API but we have tested it, and it works.

Feedback and Issues

If you notice any bugs or other issues, submit a patch or send us a pull request. You can also send us an email at support@leftronic.com.

Something went wrong with that request. Please try again.