Skip to content

myaweb API

Ryan Slominski edited this page May 9, 2017 · 9 revisions

Introduction

In order to obtain MYA archiver data on the web we've created a web service that serves up the data. To start we simply wrap calls around the command line tools myget, mySampler, and myStats (two use camelCase and the other does not). The web service is located at:

Input / Output

The parameters mimic the command line tools (no hyphen / dash though). The response is a JSON object containing an attribute "data" of type array. If a problem occurs an attribute named "error" will provide the reason (command line error output) and also the HTTP return code will be 400. An additional parameter "jsonp" ("JSON with padding"), is accepted and instructs the result to be wrapped in a function call named with the value of the parameter and having content type "application/javascript" (as opposed to "application/json"). The JSONP support allows the web service to be used from web browsers regardless of origin server. Timestamps are in ISO 8601 format (with date & time) in implicit local timezone. Since record values from the archiver sometimes are special flags such as denoting a gap the values are all strings.

Example

A web form provides an easy way to build queries for later incorporation into an application for programmatic access:

Clone this wiki locally