.. 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=allhttp://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.
.. 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.
.. 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.
.. 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 !
.. 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.
.. 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.
.. 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
.. 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
.. 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 !
.. 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.