Open IgnisDa opened 1 year ago
Sure but I could implement that in openScale sync if it has a easy to use API and not directly in openScale.
Yes, that is what I meant.
easy to use API
What kind of API is needed?
How are you typically implement your API? wger use the following REST API https://wger.de/api/v2/
But what I normally need for syncing are at least the following methods:
insert new measurement
delete a measurement
update a measurement
get a list of all stored measurements
clear all measurements
I am using the date/time as an unique identifier for each measurement.
Cool, will update here when I implement them.
@oliexdev I added graphql queries/mutations for adding measurements.
First login to https://ryot.fly.dev and then https://ryot.fly.dev/settings/tokens generate a token. All requests to the graphql endpoint must have the header: X-Auth-Token
: <copied-token>
.
You can inspect the request and response structures in https://ryot.fly.dev/graphql.
mutation createUserMeasurement
mutation deleteUserMeasurement
query userMeasurementsList
Please ping me here if anything else is needed.
Hello @oliexdev, any updates on this? Anything I can do to help?
I am not familiar with the graphQL, it seems more complex than the wger REST API. I am using retrofit2 to interact with the wger REST API.
Are you familiar with Android programming in Java? Or could you provide some curl examples for each operation?
Yes, I am familiar. A graphql request can be converted to curl easily. Here is the request for creating a measurement.
curl 'https://ryot.fly.dev/graphql' -X POST -H 'Content-Type: application/json' --data-raw '{"query":"mutation CreateUserMeasurement($input: UserMeasurementInput!) {\n createUserMeasurement(input: $input)\n}","variables":{"input":{"timestamp":"2023-08-23T08:08:28.676Z","name":"This is a test.","stats":{"weight":"78.900","muscle":"34.560"},"comment":"Some comment."}}}'
You can do it yourself by opening the network tab and using the "Copy as Curl" button for any graphql endpoint. You can get the contents of the query/mutation from here: https://github.com/IgnisDa/ryot/tree/main/libs/graphql/src/backend.
How come that this feature request has the label question
?
For anyone following this, Ryot can now import from Openscale (v5.0.4
).
For anyone following this, Ryot can now import from Openscale (
v5.0.4
).
but this is a manual sync then, right?
And you probably created this issue back then to have an automatic sync via openScale sync, is that correct?
Either way I'd love to see an automatic sync. :wink:
but this is a manual sync then, right?
Yes, it is meant as a one time import.
And you probably created this issue back then to have an automatic sync via openScale sync, is that correct?
Yes, I want Ryot sync to be added to Openscale Sync too hence this issue is still open.
Hello, awesome project! I am the developer of Ryot. I have started working on add fitness tracking support to my project and was recommended to check this project out.
I see that openScale has support for wger. Would you be willing to accept contributions for syncing with Ryot directly?
It would take me a couple of months to complete the fitness tracking support for Ryot and would like to add sync support after that.