-
-

Activities

+
+

Workouts

-
-GET /api/activities
-

Get activities for the authenticated user.

+
+GET /api/workouts
+

Get workouts for the authenticated user.

Example requests:

  • without parameters

-
GET /api/activities/ HTTP/1.1
+
GET /api/workouts/ HTTP/1.1
 
  • with some query parameters

-
GET /api/activities?from=2019-07-02&to=2019-07-31&sport_id=1  HTTP/1.1
+
GET /api/workouts?from=2019-07-02&to=2019-07-31&sport_id=1  HTTP/1.1
 

Example responses:

    -
  • returning at least one activity

  • +
  • returning at least one workout

HTTP/1.1 200 OK
 Content-Type: application/json
 
   {
     "data": {
-      "activities": [
+      "workouts": [
         {
-          "activity_date": "Mon, 01 Jan 2018 00:00:00 GMT",
           "ascent": null,
           "ave_speed": 10.0,
           "bounds": [],
@@ -169,46 +168,46 @@
           "min_alt": null,
           "modification_date": null,
           "moving": "0:17:04",
-          "next_activity": 3,
+          "next_workout": 3,
           "notes": null,
           "pauses": null,
-          "previous_activity": null,
+          "previous_workout": null,
           "records": [
             {
-              "activity_date": "Mon, 01 Jan 2018 00:00:00 GMT",
-              "activity_id": "kjxavSTUrJvoAh2wvCeGEF",
               "id": 4,
               "record_type": "MS",
               "sport_id": 1,
               "user": "admin",
-              "value": 10.0
+              "value": 10.0,
+              "workout_date": "Mon, 01 Jan 2018 00:00:00 GMT",
+              "workout_id": "kjxavSTUrJvoAh2wvCeGEF"
             },
             {
-              "activity_date": "Mon, 01 Jan 2018 00:00:00 GMT",
-              "activity_id": "kjxavSTUrJvoAh2wvCeGEF",
               "id": 3,
               "record_type": "LD",
               "sport_id": 1,
               "user": "admin",
-              "value": "0:17:04"
+              "value": "0:17:04",
+              "workout_date": "Mon, 01 Jan 2018 00:00:00 GMT",
+              "workout_id": "kjxavSTUrJvoAh2wvCeGEF"
             },
             {
-              "activity_date": "Mon, 01 Jan 2018 00:00:00 GMT",
-              "activity_id": "kjxavSTUrJvoAh2wvCeGEF",
               "id": 2,
               "record_type": "FD",
               "sport_id": 1,
               "user": "admin",
-              "value": 10.0
+              "value": 10.0,
+              "workout_date": "Mon, 01 Jan 2018 00:00:00 GMT",
+              "workout_id": "kjxavSTUrJvoAh2wvCeGEF"
             },
             {
-              "activity_date": "Mon, 01 Jan 2018 00:00:00 GMT",
-              "activity_id": "kjxavSTUrJvoAh2wvCeGEF",
               "id": 1,
               "record_type": "AS",
               "sport_id": 1,
               "user": "admin",
-              "value": 10.0
+              "value": 10.0,
+              "workout_date": "Mon, 01 Jan 2018 00:00:00 GMT",
+              "workout_id": "kjxavSTUrJvoAh2wvCeGEF"
             }
           ],
           "segments": [],
@@ -217,7 +216,8 @@
           "user": "admin",
           "weather_end": null,
           "weather_start": null,
-          "with_gpx": false
+          "with_gpx": false,
+          "workout_date": "Mon, 01 Jan 2018 00:00:00 GMT"
         }
       ]
     },
@@ -226,14 +226,14 @@
 
    -
  • returning no activities

  • +
  • returning no workouts

HTTP/1.1 200 OK
 Content-Type: application/json
 
   {
       "data": {
-          "activities": []
+          "workouts": []
       },
       "status": "success"
   }
@@ -248,7 +248,7 @@
 
Query Parameters
  • page (integer) – page if using pagination (default: 1)

  • -
  • per_page (integer) – number of activities per page +

  • per_page (integer) – number of workouts per page (default: 5, max: 50)

  • sport_id (integer) – sport id

  • from (string) – start date (format: %Y-%m-%d)

  • @@ -285,11 +285,11 @@
-
-GET /api/activities/(string: activity_short_id)
-

Get an activity

+
+GET /api/workouts/(string: workout_short_id)
+

Get an workout

Example request:

-
GET /api/activities/kjxavSTUrJvoAh2wvCeGEF HTTP/1.1
+
GET /api/workouts/kjxavSTUrJvoAh2wvCeGEF HTTP/1.1
 

Example responses:

@@ -301,9 +301,8 @@ { "data": { - "activities": [ + "workouts": [ { - "activity_date": "Sun, 07 Jul 2019 07:00:00 GMT", "ascent": null, "ave_speed": 16, "bounds": [], @@ -318,10 +317,10 @@ "min_alt": null, "modification_date": "Sun, 14 Jul 2019 18:57:22 GMT", "moving": "0:45:00", - "next_activity": 4, - "notes": "activity without gpx", + "next_workout": 4, + "notes": "workout without gpx", "pauses": null, - "previous_activity": 3, + "previous_workout": 3, "records": [], "segments": [], "sport_id": 1, @@ -329,7 +328,8 @@ "user": "admin", "weather_end": null, "weather_start": null, - "with_gpx": false + "with_gpx": false, + "workout_date": "Sun, 07 Jul 2019 07:00:00 GMT" } ] }, @@ -345,7 +345,7 @@ { "data": { - "activities": [] + "workouts": [] }, "status": "not found" } @@ -355,7 +355,7 @@
Parameters
  • auth_user_id (integer) – authenticate user id (from JSON Web Token)

  • -
  • activity_short_id (string) – activity short id

  • +
  • workout_short_id (string) – workout short id

Request Headers
@@ -373,18 +373,18 @@

  • 403 Forbidden – You do not have permissions.

  • -
  • 404 Not Found – activity not found

  • +
  • 404 Not Found – workout not found