List Courses

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

Retrieves a list of the user's courses. A course is a named route. It may contain detailed map data, which you will need to query separately.

Parameters

Parameter Type Description
access_token string (required) OAuth 2.0 token for the current user.
limit integer The total number of records to be returned. Must be between 1 and 100, inclusive. If not specified, limit will be defaulted to 50.
offset integer 0-based index of the first course to be returned.
sortBy integer

Specifies how the returned courses should be sorted. One of the following:

  • 0: Last time the course was used, in decending order.
  • 1: Course name, alphabetically.
  • 2: Course distance.

Response

Parameter Type Description
entries Course[] An array of course objects.
numEntries integer Total number of courses.

Example

Request

List 30 courses starting at entry 20. The results will be sorted by name.

https://api.runningahead.com/rest/logs/me/courses?
access_token=VjU5s4dyhAPO2XiUzaNVeE&
limit=30&
offset=20&
sortBy=1

Response

{
    "code": 0,
    "data":
    {
        "entries":
        [
            {
                "distance":
                {
                    "unit": "mi",
                    "value": 5
                }
                "id": "d4faa3d754ba4dbc8c0517872a89c722",
                "name": "Irish American 5 Miler"
            },
            {
                "distance":
                {
                    "unit": "mi",
                    "value": 4.8
                }
                "id": "63876660119d4fa09ddacd6981dee356",
                "name": "Woburn Horn Pond Loop"
            },
            {
                "distance":
                {
                    "unit": "mi",
                    "value": 26.2
                }
                "id": "dd8bdfe3622b42daa30e24124525c9b8",
                "name": "Boston Marathon"
            }
        ],
        "numEntries": 23
    }
}