The endpoint moved, this is the new URL. It looks like this code should probably be sending Accept: application/json headers throughout, but it's not really required as Garmin Connect seems to return JSON responses by default anyway.
Should be fixed by 2e3597a.
I found that the proposed change actually did not work (the path contains no json/ part).
But thanks for reporting and for leading in the right direction!
The endpoint moved, this is the new URL. It looks like this code should probably be sending
Accept: application/json
headers throughout, but it's not really required as Garmin Connect seems to return JSON responses by default anyway.