- enable or disable a sport (a sport can be disabled even if activity with this sport exists)
- enable or disable a sport (a sport can be disabled even if workout with this sport exists)
Account
^^^^^^^
@ -33,29 +33,29 @@ Account
- A user can reset his password (*new in 0.3.0*)
Activities/Workouts
^^^^^^^^^^^^^^^^^^^
- 6 sports supported:
Workouts
^^^^^^^^
- 6 sports are supported:
- Cycling (Sport)
- Cycling (Transport)
- Hiking
- Montain Biking
- Running
- Walking
- Dashboard with month calendar displaying activities and record. The week can start on Sunday or Monday (which can be changed in the user settings)
- Activity creation by uploading a gpx file. An activity can even be created without gpx (the user must enter date, time, duration and distance)
- An activity with a gpx file can be displayed with map, weather (if the DarkSky API key is provided) and charts (speed and elevation). Segments can be displayed
- Activity edition and deletion. User can add a note
- Dashboard with month calendar displaying workouts and record. The week can start on Sunday or Monday (which can be changed in the user settings)
- Workout creation by uploading a gpx file. A workout can even be created without gpx (the user must enter date, time, duration and distance)
- A workout with a gpx file can be displayed with map, weather (if the DarkSky API key is provided) and charts (speed and elevation). Segments can be displayed
- Workout edition and deletion. User can add a note
- User statistics
- User records by sports:
- average speed
- farest distance
- longest duration
- maximum speed
- Activities list and filter
- Workours list and filter
.. note::
for now, only the owner of the activity can see the activity.
for now, only the owner of the workout can see it.
<ahref="index.html"title="Previous Chapter: API documentation"><spanclass="glyphicon glyphicon-chevron-left visible-sm"></span><spanclass="hidden-sm hidden-tablet">« API documentation</span>
<codeclass="sig-name descname">GET </code><codeclass="sig-name descname">/api/stats/</code><spanclass="sig-paren">(</span><emclass="sig-param">user_name</em><spanclass="sig-paren">)</span><codeclass="sig-name descname">/by_time</code><aclass="headerlink"href="#get--api-stats-(user_name)-by_time"title="Permalink to this definition">¶</a></dt>
<dd><p>Get activities statistics for a user by time</p>
<dd><p>Get workouts statistics for a user by time</p>
<codeclass="sig-name descname">GET </code><codeclass="sig-name descname">/api/stats/</code><spanclass="sig-paren">(</span><emclass="sig-param">user_name</em><spanclass="sig-paren">)</span><codeclass="sig-name descname">/by_sport</code><aclass="headerlink"href="#get--api-stats-(user_name)-by_sport"title="Permalink to this definition">¶</a></dt>
<dd><p>Get activities statistics for a user by sport</p>
<dd><p>Get workouts statistics for a user by sport</p>
<p><strong>Example requests</strong>:</p>
<ulclass="simple">
<li><p>without parameters (get stats for all sports with activities)</p></li>
<li><p>without parameters (get stats for all sports with workouts)</p></li>
<h1>Activities<aclass="headerlink"href="#activities"title="Permalink to this headline">¶</a></h1>
<divclass="section"id="workouts">
<h1>Workouts<aclass="headerlink"href="#workouts"title="Permalink to this headline">¶</a></h1>
<dlclass="http get">
<dtid="get--api-activities">
<codeclass="sig-name descname">GET </code><codeclass="sig-name descname">/api/activities</code><aclass="headerlink"href="#get--api-activities"title="Permalink to this definition">¶</a></dt>
<dd><p>Get activities for the authenticated user.</p>
<dtid="get--api-workouts">
<codeclass="sig-name descname">GET </code><codeclass="sig-name descname">/api/workouts</code><aclass="headerlink"href="#get--api-workouts"title="Permalink to this definition">¶</a></dt>
<dd><p>Get workouts for the authenticated user.</p>
<codeclass="sig-name descname">GET </code><codeclass="sig-name descname">/api/activities/</code><spanclass="sig-paren">(</span><emclass="property">string: </em><emclass="sig-param">activity_short_id</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#get--api-activities-(string-activity_short_id)"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">GET </code><codeclass="sig-name descname">/api/workouts/</code><spanclass="sig-paren">(</span><emclass="property">string: </em><emclass="sig-param">workout_short_id</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#get--api-workouts-(string-workout_short_id)"title="Permalink to this definition">¶</a></dt>
<li><p><strong>auth_user_id</strong> (<em>integer</em>) – authenticate user id (from JSON Web Token)</p></li>
<li><p><strong>activity_short_id</strong> (<em>string</em>) –activity short id</p></li>
<li><p><strong>workout_short_id</strong> (<em>string</em>) –workout short id</p></li>
</ul>
</dd>
<dtclass="field-even">Request Headers</dt>
@ -373,18 +373,18 @@
</ul>
</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4">403 Forbidden</a>– You do not have permissions.</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">404 Not Found</a>–activity not found</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">404 Not Found</a>–workout not found</p></li>
<codeclass="sig-name descname">GET </code><codeclass="sig-name descname">/api/activities/</code><spanclass="sig-paren">(</span><emclass="property">string: </em><emclass="sig-param">activity_short_id</em><spanclass="sig-paren">)</span><codeclass="sig-name descname">/gpx</code><aclass="headerlink"href="#get--api-activities-(string-activity_short_id)-gpx"title="Permalink to this definition">¶</a></dt>
<dd><p>Get gpx file for an activity displayed on map with Leaflet</p>
<codeclass="sig-name descname">GET </code><codeclass="sig-name descname">/api/workouts/</code><spanclass="sig-paren">(</span><emclass="property">string: </em><emclass="sig-param">workout_short_id</em><spanclass="sig-paren">)</span><codeclass="sig-name descname">/gpx</code><aclass="headerlink"href="#get--api-workouts-(string-workout_short_id)-gpx"title="Permalink to this definition">¶</a></dt>
<dd><p>Get gpx file for an workout displayed on map with Leaflet</p>
<codeclass="sig-name descname">GET </code><codeclass="sig-name descname">/api/activities/</code><spanclass="sig-paren">(</span><emclass="property">string: </em><emclass="sig-param">activity_short_id</em><spanclass="sig-paren">)</span><codeclass="sig-name descname">/chart_data</code><aclass="headerlink"href="#get--api-activities-(string-activity_short_id)-chart_data"title="Permalink to this definition">¶</a></dt>
<dd><p>Get chart data from an activity gpx file, to display it with Recharts</p>
<codeclass="sig-name descname">GET </code><codeclass="sig-name descname">/api/workouts/</code><spanclass="sig-paren">(</span><emclass="property">string: </em><emclass="sig-param">workout_short_id</em><spanclass="sig-paren">)</span><codeclass="sig-name descname">/chart_data</code><aclass="headerlink"href="#get--api-workouts-(string-workout_short_id)-chart_data"title="Permalink to this definition">¶</a></dt>
<dd><p>Get chart data from an workout gpx file, to display it with Recharts</p>
<codeclass="sig-name descname">GET </code><codeclass="sig-name descname">/api/activities/</code><spanclass="sig-paren">(</span><emclass="property">string: </em><emclass="sig-param">activity_short_id</em><spanclass="sig-paren">)</span><codeclass="sig-name descname">/chart_data/segment/</code><spanclass="sig-paren">(</span><emclass="property">int: </em><emclass="sig-param">segment_id</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#get--api-activities-(string-activity_short_id)-chart_data-segment-(int-segment_id)"title="Permalink to this definition">¶</a></dt>
<dd><p>Get chart data from an activity gpx file, to display it with Recharts</p>
<codeclass="sig-name descname">GET </code><codeclass="sig-name descname">/api/workouts/</code><spanclass="sig-paren">(</span><emclass="property">string: </em><emclass="sig-param">workout_short_id</em><spanclass="sig-paren">)</span><codeclass="sig-name descname">/chart_data/segment/</code><spanclass="sig-paren">(</span><emclass="property">int: </em><emclass="sig-param">segment_id</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#get--api-workouts-(string-workout_short_id)-chart_data-segment-(int-segment_id)"title="Permalink to this definition">¶</a></dt>
<dd><p>Get chart data from an workout gpx file, to display it with Recharts</p>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">400 Bad Request</a>– no gpx file for this activity</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">400 Bad Request</a>– no gpx file for this workout</p></li>
<li><p>Signature expired. Please log in again.</p></li>
<li><p>Invalid token. Please log in again.</p></li>
</ul>
</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">404 Not Found</a>–activity not found</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">404 Not Found</a>–workout not found</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1">500 Internal Server Error</a>–</p></li>
<codeclass="sig-name descname">GET </code><codeclass="sig-name descname">/api/activities/</code><spanclass="sig-paren">(</span><emclass="property">string: </em><emclass="sig-param">activity_short_id</em><spanclass="sig-paren">)</span><codeclass="sig-name descname">/gpx/segment/</code><spanclass="sig-paren">(</span><emclass="property">int: </em><emclass="sig-param">segment_id</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#get--api-activities-(string-activity_short_id)-gpx-segment-(int-segment_id)"title="Permalink to this definition">¶</a></dt>
<dd><p>Get gpx file for an activity segment displayed on map with Leaflet</p>
<codeclass="sig-name descname">GET </code><codeclass="sig-name descname">/api/workouts/</code><spanclass="sig-paren">(</span><emclass="property">string: </em><emclass="sig-param">workout_short_id</em><spanclass="sig-paren">)</span><codeclass="sig-name descname">/gpx/segment/</code><spanclass="sig-paren">(</span><emclass="property">int: </em><emclass="sig-param">segment_id</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#get--api-workouts-(string-workout_short_id)-gpx-segment-(int-segment_id)"title="Permalink to this definition">¶</a></dt>
<dd><p>Get gpx file for an workout segment displayed on map with Leaflet</p>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">400 Bad Request</a>– no gpx file for this activity</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">400 Bad Request</a>– no gpx file for this workout</p></li>
<li><p>Signature expired. Please log in again.</p></li>
<li><p>Invalid token. Please log in again.</p></li>
</ul>
</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">404 Not Found</a>–activity not found</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">404 Not Found</a>–workout not found</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1">500 Internal Server Error</a>–</p></li>
</ul>
</dd>
@ -630,11 +630,11 @@
</dd></dl>
<dlclass="http get">
<dtid="get--api-activities-map-(map_id)">
<codeclass="sig-name descname">GET </code><codeclass="sig-name descname">/api/activities/map/</code><spanclass="sig-paren">(</span><emclass="sig-param">map_id</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#get--api-activities-map-(map_id)"title="Permalink to this definition">¶</a></dt>
<dd><p>Get map image for activities with gpx</p>
<dtid="get--api-workouts-map-(map_id)">
<codeclass="sig-name descname">GET </code><codeclass="sig-name descname">/api/workouts/map/</code><spanclass="sig-paren">(</span><emclass="sig-param">map_id</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#get--api-workouts-map-(map_id)"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">POST </code><codeclass="sig-name descname">/api/activities</code><aclass="headerlink"href="#post--api-activities"title="Permalink to this definition">¶</a></dt>
<dd><p>Post an activity with a gpx file</p>
<dtid="post--api-workouts">
<codeclass="sig-name descname">POST </code><codeclass="sig-name descname">/api/workouts</code><aclass="headerlink"href="#post--api-workouts"title="Permalink to this definition">¶</a></dt>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">400 Bad Request</a>–<ul>
<li><p>Invalid payload.</p></li>
<li><p>No file part.</p></li>
@ -820,11 +820,11 @@
</dd></dl>
<dlclass="http post">
<dtid="post--api-activities-no_gpx">
<codeclass="sig-name descname">POST </code><codeclass="sig-name descname">/api/activities/no_gpx</code><aclass="headerlink"href="#post--api-activities-no_gpx"title="Permalink to this definition">¶</a></dt>
<dd><p>Post an activity without gpx file</p>
<dtid="post--api-workouts-no_gpx">
<codeclass="sig-name descname">POST </code><codeclass="sig-name descname">/api/workouts/no_gpx</code><aclass="headerlink"href="#post--api-workouts-no_gpx"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">PATCH </code><codeclass="sig-name descname">/api/activities/</code><spanclass="sig-paren">(</span><emclass="property">string: </em><emclass="sig-param">activity_short_id</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#patch--api-activities-(string-activity_short_id)"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">PATCH </code><codeclass="sig-name descname">/api/workouts/</code><spanclass="sig-paren">(</span><emclass="property">string: </em><emclass="sig-param">workout_short_id</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#patch--api-workouts-(string-workout_short_id)"title="Permalink to this definition">¶</a></dt>
<li><p>Invalid token. Please log in again.</p></li>
</ul>
</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">404 Not Found</a>–activity not found</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">404 Not Found</a>–workout not found</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1">500 Internal Server Error</a>–</p></li>
<codeclass="sig-name descname">DELETE </code><codeclass="sig-name descname">/api/activities/</code><spanclass="sig-paren">(</span><emclass="property">string: </em><emclass="sig-param">activity_short_id</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#delete--api-activities-(string-activity_short_id)"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">DELETE </code><codeclass="sig-name descname">/api/workouts/</code><spanclass="sig-paren">(</span><emclass="property">string: </em><emclass="sig-param">workout_short_id</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#delete--api-workouts-(string-workout_short_id)"title="Permalink to this definition">¶</a></dt>
<li><p><strong>auth_user_id</strong> (<em>integer</em>) – authenticate user id (from JSON Web Token)</p></li>
<li><p><strong>activity_short_id</strong> (<em>string</em>) –activity short id</p></li>
<li><p><strong>workout_short_id</strong> (<em>string</em>) –workout short id</p></li>
</ul>
</dd>
<dtclass="field-even">Request Headers</dt>
@ -1102,14 +1102,14 @@
</dd>
<dtclass="field-odd">Status Codes</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5">204 No Content</a>–activity deleted</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5">204 No Content</a>–workout deleted</p></li>
<li><p>Signature expired. Please log in again.</p></li>
<li><p>Invalid token. Please log in again.</p></li>
</ul>
</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">404 Not Found</a>–activity not found</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">404 Not Found</a>–workout not found</p></li>
<li><p><aclass="reference external"href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1">500 Internal Server Error</a>– Error. Please try again or contact the administrator.</p></li>
<li><p>enable or disable a sport (a sport can be disabled even if activity with this sport exists)</p></li>
<li><p>enable or disable a sport (a sport can be disabled even if workout with this sport exists)</p></li>
</ul>
</li>
</ul>
@ -176,11 +176,11 @@
<li><p>A user can reset his password (<em>new in 0.3.0</em>)</p></li>
</ul>
</div>
<divclass="section"id="activities-workouts">
<h3>Activities/Workouts<aclass="headerlink"href="#activities-workouts"title="Permalink to this headline">¶</a></h3>
<divclass="section"id="workouts">
<h3>Workouts<aclass="headerlink"href="#workouts"title="Permalink to this headline">¶</a></h3>
<ulclass="simple">
<li><dlclass="simple">
<dt>6 sports supported:</dt><dd><ul>
<dt>6 sports are supported:</dt><dd><ul>
<li><p>Cycling (Sport)</p></li>
<li><p>Cycling (Transport)</p></li>
<li><p>Hiking</p></li>
@ -191,10 +191,10 @@
</dd>
</dl>
</li>
<li><p>Dashboard with month calendar displaying activities and record. The week can start on Sunday or Monday (which can be changed in the user settings)</p></li>
<li><p>Activity creation by uploading a gpx file. An activity can even be created without gpx (the user must enter date, time, duration and distance)</p></li>
<li><p>An activity with a gpx file can be displayed with map, weather (if the DarkSky API key is provided) and charts (speed and elevation). Segments can be displayed</p></li>
<li><p>Activity edition and deletion. User can add a note</p></li>
<li><p>Dashboard with month calendar displaying workouts and record. The week can start on Sunday or Monday (which can be changed in the user settings)</p></li>
<li><p>Workout creation by uploading a gpx file. A workout can even be created without gpx (the user must enter date, time, duration and distance)</p></li>
<li><p>A workout with a gpx file can be displayed with map, weather (if the DarkSky API key is provided) and charts (speed and elevation). Segments can be displayed</p></li>
<li><p>Workout edition and deletion. User can add a note</p></li>
<li><p>User statistics</p></li>
<li><dlclass="simple">
<dt>User records by sports:</dt><dd><ul>
@ -206,11 +206,11 @@
</dd>
</dl>
</li>
<li><p>Activities list and filter</p></li>
<li><p>Workours list and filter</p></li>
</ul>
<divclass="admonition note">
<pclass="admonition-title">Note</p>
<p>for now, only the owner of the activity can see the activity.</p>
<p>for now, only the owner of the workout can see it.</p>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.