Skip to content

fix: use authenticated user ID instead of "me" for X bookmarks endpoint - #93

Open
Much2Less wants to merge 1 commit into
viperrcrypto:mainfrom
Much2Less:fix/x-oauth-bookmarks-user-id
Open

Much2Less wants to merge 1 commit into
viperrcrypto:mainfrom
Much2Less:fix/x-oauth-bookmarks-user-id

Conversation

@Much2Less

Copy link
Copy Markdown

Summary

  • GET /2/users/me/bookmarks isn't valid for the X API v2 bookmarks lookup endpoint — it requires the authenticated user's actual numeric ID (GET /2/users/:id/bookmarks), which is why Live Import fails with X API error: 400 right after a successful OAuth connect.
  • The user ID is already stored as x_oauth_user_id during the OAuth callback; this reads it back and uses it in the bookmarks request URL.

Fixes #92

Test plan

  • Connected an X account via Live Import OAuth 2.0 locally
  • Confirmed "Fetch Bookmarks from X" previously failed with X API error: 400
  • Applied the fix, confirmed bookmarks are fetched and imported successfully

Found and fixed with the help of an AI coding assistant (Claude) while debugging my own local setup; verified working end-to-end before opening this PR.

The X API v2 bookmarks lookup endpoint (GET /2/users/:id/bookmarks) does
not accept the literal string "me" as a path parameter — it requires the
authenticated user's numeric user ID, which X rejects otherwise with a
400. The ID is already fetched and stored as x_oauth_user_id during the
OAuth callback but was never read back in the fetch route.

Fixes viperrcrypto#92

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

[Bug] Live Import fetch fails with "X API error: 400" — bookmarks endpoint uses "me" instead of the numeric user ID

1 participant