-
Notifications
You must be signed in to change notification settings - Fork 27
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
Recent garmin API change may have broken sample code expectations and file uploads #73
Comments
another example during initial authn - looks like the scope of the change isn't small
|
Yes, basically everything in that section of the login method, including |
yeah looking in the new requests it looks it now requires user uid in the url |
Running into the same thing |
I looked at the inspectors in the browser, while there a numeric string attached to the URL, it doesn't seems like it's a User UID. It looks like a running number or state of some kind. It's sequential from all the queries being sent |
can someone confirm if this works on their end? From: To: I took this from using HTTPToolKit on IOS Version of Garmin Connect Mobile. When I did this, the connection to it seems to work. |
New User_Agent string works fine here. |
Confirming it works for me as well, and no other endpoints appear to have changed (once we get past the login process, the rest of my daily sync works) @app4g which request did you see this number on? The Garmin endpoints generally appear the same to me. Are you referring to these numbers? I think those numbers have generally always been there, and I don't think they're actually necessary for the endpoints to work EDIT: I may have misunderstood your response, and you and I may be in agreement that they don't mean anything |
making that change works for me too |
Those numbers are timestamps, time in unix format, with purpose to make them unique i guess. |
@app4g Your change worked for me as well. |
Also effecting the GarminDB project: tcgoetz/GarminDB#249 Is there an ETA on releasing the fix? |
Changing Using Using Edit: interestingly this works for me import garth
import requests
garth.resume('./tokens')
resp = requests.get('https://connectapi.garmin.com/userprofile-service/socialProfile',
headers={'authorization': garth.client.oauth2_token.__str__()})
print(resp.json()['userName'])
requests.post('https://connectapi.garmin.com/upload-service/upload/.fit',
files={'file': open('test.fit', "rb")}, headers={'authorization': garth.client.oauth2_token.__str__()}) |
Changing the User Agent worked for me. Thanks! |
Changing the User Agent worked for me as well - Any ETA on this fix being merged and be updated on PyPI @matin? As a temporary fix, you can use this code before logging in:
|
So this means you are using the default user agent string that comes with requests I guess. |
I have done a quick search out of curiosity and from what I see @matin seems to have been offline for a while in Github and other sites. Hopefully he will see these messages |
just seeing this now. will release today |
I believe I'm not using any "User-Agent" because it's a value of the "headers" dict, and I'm sending only "authorization". Wondering why "GCM-iOS-5.7.2.1" doesn't work for me, maybe because I never used the iOS client? |
merged and released #74 with 0.4.47. thanks @app4g and @cyberjunky! I apologize for being slow to react to this |
@fatsbrown can you let me know if the new version works for you, or if the UA change this doesn't resolve the issue for you |
Yes, the new version works. Previously I tried |
Looks like this problem came back and User Agent workaround isn't working anymore. Is it the case for the community or just me? |
Still working for me but I never got round to updating garth. Used a couple of times this morning. Still using the manual fix |
I got the error |
Still working for me 🙏 (not using garth directly) |
The update/fix is still working for me and I am using Garth directly. |
Same for garmin_connect/home-assistant-garmin_connect, version 0.4.47 works fine. Didn't test 0.5.2 yet. |
@cyberjunky 0.5.2 finally addresses the issue in #41 and creating the option to break up the login in process when there's MFA (based on #41 (comment)) |
Great, that was next thing on my list, I will give it a try soon! |
I had an app running for a while where I followed your sample code, ex:
And it started breaking with the following error:
I traced that back to the code trying to call the URL
https://connect.garmin.com/userprofile-service/userprofile/socialProfile
, I curl'd that url myself and it now spits back the error:For testing I commented out the line to call
garth.client.username
, and my app fails to upload the activity to garmin with a new error:The text was updated successfully, but these errors were encountered: