garmin-csv-plan
garmin-csv-plan copied to clipboard
GarminConnect.php - an unexpected response code was found: 403
Message: "An unexpected response code was found: 403"
In GarminConnect.php line 261:
An unexpected response code was found: 403
This issue is already referenced in php-garmin-connnect
project as Anyone getting 403 error from Garmin Connect starting today? #61
Thanks @pygoubet, it looks like we will need to use a headless browser or some other means of creating/editing/deleting workouts now based on the code https://github.com/petergardfjall/garminexport/pull/105/files#diff-6093a27e9170fd8a464a72b64b04bca3857c7a77fab45b8dece651661fdfb129
I'll have to look into it soon.
Cet outil est génial. J'espère que vous arriverez à trouver une solution. Merci.
For info: I get response code 402 (not 403 as reported above) but I'm guessing it's the same underlying issue
May be I fixed this issue setting on line 285 of GarminConnect.php:
$strResponse = $this->objConnector->post( 'https://connect.garmin.com/modern/workouts',
instead of 'https://connect.garmin.com/modern/proxy/workout-service/workout'
.
But now I got the error:
[critical] Error thrown while running command "garmin:workout "multi-events-day.csv" -vvv". Message: "Warning: Attempt to read property "workoutId" on null" [debug] Command "garmin:workout "multi-events-day.csv" -vvv" exited with code "1"
In GarminHelper.php line 69:
[ErrorException] Warning: Attempt to read property "workoutId" on null
Hi all,
Please test the latest release. I have updated the code base to use the latest authentication method from Garmin. Authentication is a convoluted five-step process with Garmin. It is using Garth's consumer key and secret - https://thegarth.s3.amazonaws.com/oauth_consumer.json
I have not tagged or created a release for this version, yet. I also haven't added anything to handle MFA by Garmin.
Thanks
Hi @Raistlfiren
Well done! It worked (after a little change).
It would be great if the GARMIN_AUTHENTICATION_FILE could be overridden at run time. Or hardcoded to a subfolder within the workdir /usr/src/garmin-csv-plan
. As example public const GARMIN_AUTHENTICATION_FILE = 'tmp/garmin_credentials.json';
.
In my case, /usr/src/garmin-csv-plan
is not writable, so the credential file cannot be created.
Thanks @pygoubet. I added a variable in the .env
file called GARMIN_AUTHENTICATION_FILE_PATH
where you can specify the path. :)
Many THANKS @Raistlfiren for taking the time to resolve this issue. Best regards. It works very well.
great @Raistlfiren now it works fine, thanks!
Thanks @pygoubet. I added a variable in the
.env
file calledGARMIN_AUTHENTICATION_FILE_PATH
where you can specify the path. :)
Very convenient, thanks!