Skip to content
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

Add put and delete api methods #11

Closed
OscarSalgado opened this issue Sep 29, 2023 · 3 comments · Fixed by #13
Closed

Add put and delete api methods #11

OscarSalgado opened this issue Sep 29, 2023 · 3 comments · Fixed by #13
Assignees

Comments

@OscarSalgado
Copy link
Contributor

They are useful to interact with other services, i.e. workout-service among others

@matin
Copy link
Owner

matin commented Sep 29, 2023

Happy to add them.

What endpoint uses PUT? I need it to be able to write a test.

For DELETE, I can add use weigh ins.

@OscarSalgado
Copy link
Contributor Author

For example you can use this endpoint https://github.com/OscarSalgado/garmin-workouts/blob/bec64cff1c7de2bcaefa7ec739b516cc71a3a736/garminworkouts/garmin/garminclient.py#L408
used to update your HR zones. Get first the adequate payload.

There are other endpoints using PUT, but you will need first a existing workout, or event for example.

@matin
Copy link
Owner

matin commented Sep 29, 2023

I'll add DELETE and look into PUT this weekend. In the meantime, you can always use Client.request() directly like this:

garth.client.request(
    "DELETE",
    "connectapi",
    path,
    api=True,
)

Here's an example from another project:
https://github.com/cyberjunky/python-garminconnect/blob/master/garminconnect/__init__.py#L306-L316

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants