Class: PublicApi

Inherits:
Sinatra::Base
  • Object
show all
Includes:
Helpers, YottaaAuth
Defined in:
controllers/public_api.rb

Overview

Overview:

Yottaa's public API provides access to all the data within the yottaa system that can be seen without logging. This data is broken into three areas:

  • urls - Applications can access public information that you has collected about any URL.

  • benchmarks - Users can create publicly visible benchmarks that can be used to compare urls.

  • reports - Yottaa has a large amount of data that can be used to drawn conclusions about website performance. We will add new an interesting reports about the websites we track.

Authentication:

3rd party applications wanting to use the public API, must register for a Yottaa account. Within the user account settings you will see the "API Access" section. Click the "Enable Access" button to get your API key.

Add the API key to your REST request as a HTTP Header

YOTTAA-API-KEY: 7d04a0db7dcfc6afead3226fa2e86ce39fc515b0

Request that do not contain a valid API Key will be return a HTTP 403 (Access Denied) response code.

Instance Method Summary (collapse)

Instance Method Details

- (Object) GET '/public/monitor/capabilities.?:response_type?'

REPORTS

Reports APIs provide access to data that we deem interesting to Yottaa or the general public

Retrieve monitor capabilities

Overview:

Fetch monitor locations.

URL:

/public/monitor/capabilities

Filtering Parameters:

operation

(http | webpage) - default is nil

browsers

ff-3.6,ie-8,chrome-latest ff: firefox ie: Internet Explorer chrome: Chrome

Requires Authentication:

NO

HTTP Method

GET

Examples:

curl -H "YOTTAA-API-KEY: 508a303ec3666e0fae000002" https://api.yottaa.com/public/monitor/capabilities

curl -H "YOTTAA-API-KEY: 508a303ec3666e0fae000002" https://api.yottaa.com/public/monitor/capabilities?operation=webpage&browsers=ff-3.6,ie-8

- (Object) GET '/public/sites/samples.?:response_type?'

Retrieve one latest sample for a site

Overview:

Retrieve one latest sample for a site(if host is specified).

URL:

public/sites/samples

Parameters:

host: samples for specified site host name, this is a match query.

Responses:

{
   "duration": null,
   "name": "default http monitor",
   "ref_profile_id": null,
   "run_times": null
}

Requires Authentication:

YES

HTTP Method:

GET

Examples:

curl -H "YOTTAA-API-KEY: 80189f00e9b5012f981b34159e206" api.yottaa.com/public/sites/samples?host=http://www.yottaa.com