Save Course

New course:

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

Existing course:

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

Request Body

Both endpoints accept a Course object.

The API supports GZIP compression. If you compressed the data, you need to include the HTTP header "Content-Encoding: gzip".

Response

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

Examples

Saving a new course

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

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

Specify the course data in the POST body:

{
    "distance":
    {
        "unit": "mi",
        "value": 26.20
    },
    "name": "Boston Marathon",
    "notes": "Heartbreak Hill broke my heart.",
    "surfaces":
    {
        "asphalt": true
    }
}

Updating an existing course

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

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

Specify the course data in the POST body:

{
    "distance":
    {
        "value": 25,
        "unit": "km"
    }
    "name": "Around Cape Ann 25k",
    "notes": "Rolling hills for the entire course.  Long hill at mile 14.  Short steep hill at mile 15.2",
    "surfaces":
    {
        "asphalt": true
    }
}