Skip to content

Timestreams API Documentation

pszjmb1 edited this page Jun 21, 2012 · 45 revisions

Timestreams is an API that provides functions to add and organise sensor data. It allows you to connect information from your community or school with your blog and the rest of the world.

Description

Timestreams supports an XML-RPC API which can be called by an external client to create sensor readings tables, add readings, metadata, contextual information and timestreams, and find such data. Timestreams has a refernce implementation for WordPress. The Timestreams API extends the native Wordpress XML-RPC API so all of the native functions are available as well within the refernce implementation.

The Timestreams API is built around data-classes describing measurements, metadata, documentation, context, and timestreams. This document describes the XML-RPC functions that are available to manipulate these data-classes. To use the API you will need a server implementation of it. Follow the instructions to install the API reference implementation. To use the reference implementation post XML method calls to your Wordpress installation's xmlrpc.php page. cURLis a useful tool to use to test your calls. The following is an example using curl to make an XML-RPC call:

curl --noproxy localhost -d "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?><methodCall><methodName>timestreams.insert_reading</methodName><params><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><string>wp_1_ts_temperature_1</string></value></param><param><value><string>6.7</string></value></param><param><value><string>2012-03-02 00:34:00</string></value></param></params></methodCall>" http://localhost/wordpress/xmlrpc.php


Data-classes

The following lists the XML-RPC methods by data-class:

Measurements

Measurements contain values at given points in time for blog instance devices.

Attribute Description Required
[type][blog_id]_[device_id]_id Id of this measurement Yes

The following functions are avaialable to manipulate measurements:

  • timestreams.create_measurements
  • timestreams.add_measurement
  • timestreams.add_measurements
  • timestreams.select_measurements
  • timestreams.select_first_measurement
  • timestreams.select_latest_measurement
  • timestreams.count_measurements

Metadata

Documentation

Context

Timestreams

Clone this wiki locally