Skip to content

fix: use Facebook Graph API for Instagram media operations#134

Merged
chubes4 merged 1 commit intomainfrom
fix/instagram-fb-graph-api
Apr 27, 2026
Merged

fix: use Facebook Graph API for Instagram media operations#134
chubes4 merged 1 commit intomainfrom
fix/instagram-fb-graph-api

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented Apr 27, 2026

Summary

  • Switch all Instagram media API calls from graph.instagram.com to graph.facebook.com/v18.0 — our OAuth flow uses Facebook Login which mints FB-flavored tokens; graph.instagram.com rejects these with error code 190 ("Cannot parse access token")
  • Same root cause already fixed in v0.12.1 for username lookup (InstagramAuth), now applied to the media operations layer
  • Affects: container creation, status polling, media_publish, permalink fetch, media listing, caption editing, deletion, and archiving

Changed files

File Change
InstagramPublishAbility.php GRAPH_API_URLgraph.facebook.com/v18.0
InstagramReadAbility.php GRAPH_API_URLgraph.facebook.com/v18.0
InstagramUpdateAbility.php GRAPH_API_URLgraph.facebook.com/v18.0
InstagramDeleteAbility.php GRAPH_API_URLgraph.facebook.com/v18.0

Residual risk

  1. Token refreshInstagramAuth::do_refresh_token() still uses graph.instagram.com/refresh_access_token with ig_refresh_token grant. May also reject FB-flavored tokens. Separate fix needed.
  2. API version — v18.0 matches InstagramAuth. InstagramCommentReplyAbility and Facebook abilities use v23.0. Future alignment PR.
  3. No integration test — URL constant swap only; request shapes unchanged. Needs a real publish test post-deploy.

All Instagram ability classes (Publish, Read, Update, Delete) were using
graph.instagram.com which rejects FB-flavored access tokens with code 190
"Cannot parse access token". Our OAuth flow issues FB-flavored tokens via
Facebook Login, so all media endpoints must go through graph.facebook.com.

This is the same root cause fixed in v0.12.1 for username lookup
(InstagramAuth), now applied to the media operations layer.

Affects: container creation, status polling, media_publish, permalink
fetch, media listing, caption editing, deletion, and archiving.
@chubes4 chubes4 merged commit aca2263 into main Apr 27, 2026
1 check failed
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