Skip to content

fix: Strava API breaking changes (effective June 1, 2027) - #4830

Open
cagnulein wants to merge 1 commit into
masterfrom
fix/strava-api-v3-breaking-changes
Open

fix: Strava API breaking changes (effective June 1, 2027)#4830
cagnulein wants to merge 1 commit into
masterfrom
fix/strava-api-v3-breaking-changes

Conversation

@cagnulein

Copy link
Copy Markdown
Owner

Summary

Strava announced breaking changes to their API effective June 1, 2027:

  • Authorization tokens must be sent in request headers, not form params
  • The API base URL is changing from https://www.strava.com/api/v3 to https://www.api-v3.strava.com

Changes in homeform::strava_upload_file() (src/homeform.cpp):

  • Updated upload URL: https://www.strava.com/api/v3/uploadshttps://www.api-v3.strava.com/uploads
  • Removed access_token multipart form field
  • Added Authorization: Bearer <token> request header

The OAuth token endpoints (/oauth/token, /oauth/authorize) are not affected by this change.

Test plan

  • Connect Strava account and upload a workout — verify it appears on Strava
  • Verify token refresh still works correctly before upload

🤖 Generated with Claude Code

- Change base URL from https://www.strava.com/api/v3 to https://www.api-v3.strava.com
- Move authorization token from multipart form param to Authorization: Bearer header

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cagnulein

Copy link
Copy Markdown
Owner Author

I tested the Strava upload flow on Android with Experimental → Debug Log enabled, after Roberto had already linked Strava successfully.

Findings from the device logs:

  • Token refresh succeeds, so authentication itself is OK:
    • strava_refreshtoken() returns HTTP 200 and a valid bearer token response.
  • FIT generation succeeds before upload:
    • FitDatabaseProcessor processes the generated .fit file.
    • strava_upload_file_prepare() is called with the FIT path.
  • Upload then fails before reaching Strava because the new host does not resolve yet:
    • QNetworkReply::HostNotFoundError
    • Host www.api-v3.strava.com not found
    • HTTP status code 0

This matches Strava's developer-program email: the API base URL changes from https://www.strava.com/api/v3 to https://www.api-v3.strava.com, but only effective June 1, 2027. Today the new hostname is not live yet, so using it now breaks uploads.

Suggested fix for this PR:

  1. Keep sending OAuth/access tokens in the Authorization: Bearer ... request header (that part is good and future-compatible).
  2. Do not switch the upload base URL to https://www.api-v3.strava.com until the 2027 cutover, or implement a fallback/time-gated endpoint selection.
    • Current working upload endpoint for now: https://www.strava.com/api/v3/uploads
    • Future announced endpoint: https://www.api-v3.strava.com/uploads
  3. Also fix the completion handler: writeFileCompleted() currently shows/logs success even after errorOccurredUploadStrava() fires. It should check reply->error() == QNetworkReply::NoError before showing Strava Upload Completed!.

@stale

stale Bot commented Aug 7, 2026

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix This will not be worked on label Aug 7, 2026
@stale stale Bot closed this Aug 16, 2026
@cagnulein cagnulein reopened this Aug 16, 2026
@stale stale Bot removed the wontfix This will not be worked on label Aug 16, 2026
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 this pull request may close these issues.

1 participant