-
-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wger (open source workout manager) weight sync support #683
Comments
I actually already played a bit around with the wger API, see wger-project/wger#448 |
Thanks, good to know |
FYI that was only for some of the exercise related endpoints (we recently changed some of the DB structure and still need to make sure the submission process works), I should have been clearer there. The weight endpoint should have no problems with PATCH and DELETE (and if it does, just ping me) |
@rolandgeider unfortunately, for me it still not work at https://wger.de/api/v2/weightentry/ there is no PATCH or DELETE operation allowed:
But I might do something wrong? If I try to delete something, I always get this back as a response |
That is strange. Did you send the auth header? I'm developing a flutter app that talks to the server via the regular REST API and it definitely works |
I used this command (XYZ is replaced with the correct token)
|
It does look like a bug, that should work |
I have found what's wrong, hadn't seen it in the beginning. To PATCH a specific weight entry you'd use |
@rolandgeider thanks it works now 👍 sorry for the confusion |
@rolandgeider I have implemented a first version for synchronization openScale sync with wger. It works good but I have two remarks:
Would you consider to change that in your REST API? If yes how fast could that be implemented in wger? |
Nice!! Yes, there is also a uniqueness constraint in the model, so that only one entry per user and date can be saved. Adding more wouldn't make much sense for an app like wger and makes things like plotting the chart easier if there aren't duplicate entries. And as for the ID, you can search if there are entries for a specific date with |
@rolandgeider thanks for the hint with the date query, I use this instead of fetching all data. I have been released the openScale sync 0.3.2 , which should support the synchronization with wger. Thanks for your open-source workout manager. 🏅 |
Is your feature request related to a problem? Please describe.
There aren't many open source health trackers but probably most known (or only existing) is wger which has REST API too.
Describe the solution you'd like
It would be useful to have wger support to sync along with google fit and mqtt.
Describe alternatives you've considered
Possible alternative is to support openscale MQTT protocol. But openScale is not a service from where you can "pull" the data but rather "push"-based client.
MQTT output which exists in sync is only useful for services you write yourself otherwise it isn't good practise to support multiple client APIs in single service.
Also there's no "standard" API specifications for this kind of thing so you already must implement healthkit/google fit integrations different.
Additional context
Here is the documentation for API.
You must know beforehand server endpoint (because, well, it is self-hosted) but you may use
https://wger.de/api/v2/
as default one.Before sending requests you must send
POST /api/v2/login
to obtain token usingContent-Type: application/json
with payload containingusername
andpassword
. It is a bit unclear from documentation so I made an issue here.After that you may send
POST api/v2/weightentry/
usingAuthorization: Token
andContent-Type: application/json
withdate
andweight
fields.The text was updated successfully, but these errors were encountered: