Open Data APIs for Data Requests - OpenData-tu/documentation GitHub Wiki

Open Data APIs for Data Requests

Version Date Modified by Summary of changes
0.1 2017-05-16 Nico Tasche Initial version

1. Preface

This document describes the request API to access the saved data.

2. Requests

There are three ways of requesting data from the database. Common to all reqests is a fixed timeout, which has not been determent yet.

2.1. Via simple GET Request

Simple means really simple.

Schema

GET /{provider}/{type}/filter?{query_parameters}

Provider

describes the data source type: Describes one single type of data, like temperature. Use all, to get all data from each device

Query parameters

Name Type Example Description
from string 2016-05-01 data from which time on
to string 2016-05-20 data until what time
location string 52.427764, 13.529493 location in lat, long
radius int 5 radius in m

Response

Array of full data-set fitting those parameters.

2.2. Via POST Request

The POST request allows predefined parameters send in the body.

POST /search
{
 "provider": ["index1", "index2"],
 "types": ["rain", "temperature"],
 "range": {"from":"2016-05-01","to":"2016-05-20"},
 "filter": { ... },
 "agg": { ... },
 ...

}

2.3. Via Elasticsearch POST Request

Allows actual Elasticsearch requests. It's basically an interface to the full Elasticseach power without allowing the user to break anything.