Save Workout

New workout:

POST https://api.runningahead.com/rest/logs/me/workouts

Existing workout:

PUT https://api.runningahead.com/rest/logs/me/workouts/{id}

Request Body

Both endpoints accept a workout object.

Note that the API currently supports 1 piece of equipment per workout. A future release will allow you to save multiple equipment.

Response

Parameter Type Description
id string If the save operation is successful, then the workout's ID will be returned.

Examples

Saving a new workout

To create a new workout, post to the following endpoint:

https://api.runningahead.com/rest/logs/me/workouts?access_token=VjU5s4dyhAPO2XiUzaNVeE

Updating an existing course

Assuming the workout's ID is d4faa3d754ba4dbc8c0517872a89c722, posting to the following endpoint will update the workout:

https://api.runningahead.com/rest/logs/me/workouts/d4faa3d754ba4dbc8c0517872a89c722?
access_token=VjU5s4dyhAPO2XiUzaNVeE

Whether you're creating a new workout or updating an existing one, specify the workout data in the POST body:

{
    "activityID": 10,
    "course":
    {
        "id": "582b47e818b24944b47b0fc3dbbf3010"
    },
    "date": "2012-04-01",
    "details":
    {
        "distance":
        {
            "unit": "mi",
            "value": 6.96
        },
        "duration": 3277
    },
    "equipment":
    [
        { "id": "2f003f53f4ac430da90da2cfd5a8c1a5" }
    ],
    "health":
    {
        "avgHR": 149,
        "maxHR": 162,
        "weight":
        {
            "unit": "lb",
            "value": 168
        }
    },
    "intervalSet":
    {
        "id": "67eade0fb9bb492887331efbae3599d4",
        "intervals":
        [
            {
                "distance":
                {
                    "unit": "mi",
                    "value": 6.96
                },
                "type": "interval"
            }
        ]
    },
    "raceStats":
    {
        "fieldPlacement": 67,
        "fieldSize": 217,
        "groupMaxAge": 49,
        "groupMinAge": 40,
        "groupPlacement": 13,
        "groupSize": 42
    },
    "ratings":
    {
        "effort": 9,
        "quality": 6
    },
    "time": "20:18:00",
    "weather":
    {
        "conditions":
        {
            "overcast": true,
            "snow": true,
            "windy": true
        },
        "temperature":
        {
            "unit": "F",
            "value": 34
        }
    },
    "workoutID": 6
}

Notice the workout's ID, activity, workout, course names, etc are not included because they're included in GetWorkout method for ease of display in your application. If you do include them, they will be ignored by the API.