jovandeginste / workout-tracker

A workout tracking web application for personal use (or family, friends), geared towards running and other GPX-based activities
Other
945 stars 31 forks source link

Able to upload workouts (gpx) via curl? #56

Closed greenship24 closed 5 months ago

greenship24 commented 6 months ago

I'm wondering if there is an ability for this to use a simple bash script with curl to auto import workouts without having to go through the GUI. Basically, I record on my phone and it auto uploads to a nextcloud instance. I would love it if I could use a cron job with a simple bash script that did a find and then curl to upload workouts to this. Didn't know if this was possible. I assume so and if so, I can help refine the docs on it.

Thanks!

greenship24 commented 5 months ago

Maybe it was added recently or I just never saw it. Main readme has the info-

The API is documented using [swagger](https://swagger.io/). You must enable API access for your user, and copy the API key. You can use the API key as a query parameter (api-key=${API_KEY}) or as a header (Authorization: Bearer ${API_KEY}).

You can configure some tools to automatically upload files to Workout Tracker, using the POST /api/v1/import/$program API endpoint.
FitoTrack

Read [their documentation](https://codeberg.org/jannis/FitoTrack/wiki/Auto-Export) before you continue.

The path to POST to is: /api/v1/import/fitotrack?api-key=${API_KEY}