fix: use Facebook Graph API for Instagram media operations#134
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
graph.instagram.comtograph.facebook.com/v18.0— our OAuth flow uses Facebook Login which mints FB-flavored tokens;graph.instagram.comrejects these with error code 190 ("Cannot parse access token")InstagramAuth), now applied to the media operations layermedia_publish, permalink fetch, media listing, caption editing, deletion, and archivingChanged files
InstagramPublishAbility.phpGRAPH_API_URL→graph.facebook.com/v18.0InstagramReadAbility.phpGRAPH_API_URL→graph.facebook.com/v18.0InstagramUpdateAbility.phpGRAPH_API_URL→graph.facebook.com/v18.0InstagramDeleteAbility.phpGRAPH_API_URL→graph.facebook.com/v18.0Residual risk
InstagramAuth::do_refresh_token()still usesgraph.instagram.com/refresh_access_tokenwithig_refresh_tokengrant. May also reject FB-flavored tokens. Separate fix needed.InstagramAuth.InstagramCommentReplyAbilityand Facebook abilities use v23.0. Future alignment PR.