Commit Graph

24 Commits

Author SHA1 Message Date
Mark Liversedge
f65b62c13d API error message on bad athlete
.. if url athlete name is bad or missing we
   return an error message.
2015-11-19 15:22:15 +00:00
Joern
5d2ea70b2f API - documentation
... add query parameter description to source code
2015-10-25 13:11:00 +01:00
Mark Liversedge
e1312caa33 API metadata \n \r and \t
.. need conversion so it doesn't break parsers!
2015-09-17 10:37:00 +01:00
Mark Liversedge
221afed822 API ride list add metadata
.. by default no metadata is provided when you
   get a ride list. So we now let you specify
   via a parameter what metadata fields you
   want.

   e.g.
   http://localhost:12021/athlete?metadata=all
   http://localhost:12021/athlete?metadata=Workout_Code,Recording_Interval

   Metric overrides are ignored and all data is
   fixed to never send a double quote ("), it is
   converted to a single quote (') to avoid tripping
   up CSV parsers.

   To show it is a string field both the heading and
   content are always surrounded by double quotes.
2015-09-17 10:20:39 +01:00
Mark Liversedge
9d337a76aa API list rides, use response settings more
.. now we are able to manage settings with the response
   to control how the response is built we don't need to
   store it in the JSONContext structure - so just cleaning
   it up.
2015-09-17 07:51:06 +01:00
Mark Liversedge
dbf240616f API List Intervals
.. add an intervals=true|false to the fetch
   ride list URL to enable fetching of interval
   metrics as well as ride metrics.

   e.g.
   http://localhost:12021/athlete?intervals=true&metrics=Work,IF
2015-09-14 09:28:04 +01:00
Mark Liversedge
b1bb4b6259 API List Zone Config
.. just the key parameters, not the zones themselves.
   although we could add that possibly.

   URL to get zone config:
   http://localhost:12021/athlete/zones

   By default will return power zones but can be
   called with a 'for' parameter, which is one of;
   power, hr, pace, swimpace.

   The result is returned as csv data.
2015-09-10 20:28:17 +01:00
Mark Liversedge
e8325dbcdc API fix mean max bests headings 2015-09-10 16:44:44 +01:00
Mark Liversedge
3b2eb13689 API List Mean Max Bests for a Date Range
.. will return csv of the best mean max across
   a date range, or all dates if no range is
   specified.

   e.g.
   http://localhost:12021/Liversedge/meanmax/bests?series=watts&since=2015/01/01
2015-09-10 16:15:09 +01:00
Mark Liversedge
bcb7b870ca API better error handling
.. when URL malformed etc
2015-09-10 10:45:23 +01:00
Mark Liversedge
38a93ebb81 API list meanmax nits
.. csv headings should match request
.. error on unknown data series
2015-09-10 06:48:34 +01:00
Mark Liversedge
b529e04907 API MeanMax any series
.. add parameter series to specify which
   series to extract from the ridefilecache
   any of; watts, hr, cad, speed, vam, NP,
   xPower, nm.
2015-09-09 22:00:01 +01:00
Mark Liversedge
cac9b84859 API List MMP
.. returns the mean max power array for a
   given ride in csv format.

   e.g. http://http://localhost:12021/athlete/meanmax/2015_08_09_10_59_09.json

   will return the power mean max data in
   csv format.
2015-09-09 21:36:15 +01:00
Mark Liversedge
42248d5584 API List Activity Content-Type and Accept header
.. if the caller sets a content type we can provide in the
   header of the http request then we honour it; e.g.
   Accept: "text/csv" we will convert to CSV.

.. also updated to set the content type to match the file
   format we are providing; just in case the client needs to
   know what it got !
2015-09-09 14:44:09 +01:00
Mark Liversedge
2dbe960dfb API List Activities added before parameter
.. if you can list activities 'since' a date then
   it makes sense to also list those 'before' and
   then combine them to create a range.
2015-09-08 22:30:14 +01:00
Mark Liversedge
d95ec38593 API Fetch Activity format=...
.. when retreiving an activity using the API
   you can now specify the format you want the
   data to be returned in.

   it can be one of;
   tcx - garmin training centre xml
   pwx - training peaks xml
   json - goldencheetah json
   csv - all available data (not powertap csv)

.. along the way the file writers for the respective
   formats now accept a NULL context to work standalone.
   this may be useful as a file conversion tool.
2015-09-08 21:13:17 +01:00
Mark Liversedge
1d1508c524 API return activity
.. just straight up for now, so;

   http://localhost:12021/athlete/activity/2015_08_09_10_59_09.json

   will just return the ride unchanged in the format
   it is stored in. Some parameters will now be added
   to enable the format to be selected, from those that
   we can support.
2015-09-08 20:17:56 +01:00
Mark Liversedge
fa40917053 API Buffered Write
.. when sending metrics, since if no selection is made
   it can result in thousands of needless updates !
2015-09-08 11:48:46 +01:00
Mark Liversedge
d8d90370e2 API List Rides Specify Since
.. To restrict to more recent rides the
   API for list rides will now take a
   parameter 'since'

   localhost:12021/athlete/?since=2015/02/01

   Will only list rides since 1st February 2015
   and can of course be used alongside 'metrics'
   to control what metrics are returned.

   localhost:12021/athlete/?since=2015/02/01&metrics=NP
2015-09-07 19:55:14 +01:00
Mark Liversedge
58b3557f86 API List Rides Specify Metrics
.. when getting the ride list its useful to be
   able to get specific metrics (rather than all
   260 odd).

   URL can have parameter metrics that is a comma
   separated list of metrics to provide e.g;

   localhost:12021/athlete/?metrics=NP,Average_Power
2015-09-07 19:36:42 +01:00
Mark Liversedge
0abbeed952 API List Activities
.. will provide the metric db for an athlete as the
   activity list including all metrics in CSV format
   at the URL:

   http://localhost:12021/Athlete Name/

   The data is sent in chunks as it is parsed from the
   ride cache. We do not cache or maintain state so this
   call is expensive !
2015-09-07 15:36:29 +01:00
Mark Liversedge
e6cc21bfbc API List Athletes
.. easiest one first, just list athletes
   along with basic details like sex and age
2015-09-06 20:41:47 +01:00
Mark Liversedge
28eb76827c API Framework v1.0
.. just 4 endpoints available;

   - list athletes
   - list rides
   - get ride sample data
   - get ride mmp data

.. next few commits will need to implement each of the 4
   API endpoints, returning CSV data in the response.
2015-09-06 17:50:38 +01:00
Mark Liversedge
139af8d3a2 Introduce our own API service
.. just returns a dull page for now.
2015-09-06 16:27:49 +01:00