API Index

Historical Monthly Summaries - Get All Summaries

returns list of historicalmonthly summary information

uri:

http://c2logapi.appspot.com/api/1/historical/monthlysummaries

method:

GET

status codes:

200: ok
401: invalid Concept 2 Online logbook user name or password
403: invalid or missing C2 Logbook REST API key
503: throttled

Examples:


sample contents of the response body to a successful request as JSON data

[
    {
        "distance": 4538,
        "total_minutes": 20,
        "total_seconds": 0,
        "workout_type": "standard",
        "month": 12,
        "total_hours": 0,
        "link": { "href": "http://powertwenty.com/c2logapi/1/historical/monthlysummary/7111", "rel": "self" },
        "year": 2008,
        "id": 7111
    },
    {
        "distance": 15000,
        "total_minutes": 3,
        "total_seconds": 43,
        "workout_type": "standard",
        "month": 4,
        "total_hours": 1,
        "link": { "href": "http://powertwenty.com/c2logapi/1/historical/monthlysummary/8323", "rel": "self" },
        "year": 2008,
        "id": 8323
    }
]


Python using httplib2

import httplib2   
import simplejson
import base64 

h = httplib2.Http()
authorizationHeader = "Basic %s"%base64.b64encode("%s:%s"%("user", "password"))
resp, content = h.request( "http://powertwenty.com/c2logapi/1/currentseason/workouts", "GET", headers={"Authorization":authorizationHeader, "X-API-KEY":"xxxxxxxxxxxxxxx" } )
assert resp["status"]=="200"
all_historical_summaries = simplejson.loads(content) 
for historical_summary in all_historical_summaries :
    print historical_summary["distance"] 

 
 
Copyright © 2006-2015 by Power Twenty, LLC. All Rights Reserved.
Design by Interspire