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

HTTPError: 403 Client Error: Forbidden for url: https://connect.garmin.com/proxy/workout-service/workouts?start=0&limit=100 #77

Closed
AGlandier opened this issue Oct 17, 2023 · 2 comments

Comments

@AGlandier
Copy link

Hello,
When i'm trying to use your work to send workouts on my garmin account, i'm getting this error :
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://connect.garmin.com/proxy/workout-service/workouts?start=0&limit=100
I suppose that this is garmin website which is denying me the access,
Do I need an API key for their Workouts API or the issue may be caused by something else ?
(I'm using a Python 3.11.6 virtual environment with the last releases of the requirements)
Thx for your help

@jmsmkn
Copy link

jmsmkn commented Oct 22, 2023

I was facing the same problem. This library includes its own Garmin SSO auth. I couldn't work out how to fix it so switched the authentication out for Garth and updated the endpoints I used in garminclient.py, ending up with something like:

import garth

...

garth.login(username, password)

...

class GarminClient:
    
    ...

    def update_workout(self, workout_id, workout):
        path = f"{GarminClient._WORKOUT_SERVICE_ENDPOINT}/workout/{workout_id}"

        response = garth.client.request(
            "PUT",
            "connectapi",
            path,
            api=True,
            json=workout,
        )
        response.raise_for_status()

Maybe this will help you solve the same issue for the list view.

@AGlandier
Copy link
Author

Thanks for your help ! This solution worked, the error evolved into a 402 error, which has been raised in another issue ;) I am at least moving forward !

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

No branches or pull requests

2 participants