Transitioning from Instagram Basic Display API to Instagram Graph API: Concerns about token generation and API calls
I'm currently migrating an app that uses the Instagram Basic Display API (api.instagram.com
) to the Instagram Graph API (graph.instagram.com
), as the Basic Display API will be deprecated on December 4th, 2024.
I’ve read in the official documentation that I need to create a new app of type "Business" in Meta for Developers and request the instagram_business_basic
scope to perform the same actions as before.
Current Implementation
For token generation and API calls, my current workflow looks like this:
1. Short-Lived Access Token Generation
// Short-lived token $url = "https://api.instagram.com/oauth/access_token"; $fields = array( 'client_id' => MY_APP_ID, 'client_secret' => MY_APP_SECRET, 'grant_type' => 'authorization_code', 'redirect_uri' => MY_REDIRECT_URI, 'code' => $code ); return call_curl("POST", $url, $fields);
2. Long-Lived Access Token Exchange
// Long-lived token $url = "https://graph.instagram.com/access_token?grant_type=ig_exchange_token&client_secret=" . MY_APP_SECRET . "&access_token={$token}"; return call_curl("GET", $url);
3. API Calls
$data = fetchData("https://graph.instagram.com/me/media?fields={$fields}&access_token={$tokenInstagram}");
My Concerns
- The short-lived token generation process appears to still use the endpoint
https://api.instagram.com/oauth/access_token
. Is this endpoint going to stop working after the Basic Display API deprecation? - Although I’ve switched to the Instagram Graph API for token exchange (
graph.instagram.com/access_token
) and data fetching, I’m worried that the short-lived token endpoint dependency will cause issues post-deprecation. - The Graph API Explorer doesn’t list the
graph.instagram.com
endpoint, and most references online seem to usegraph.facebook.com
. Should I be usinggraph.facebook.com
instead for Instagram-related API calls?
What I’ve Done So Far
- I’ve created a new Business-type app in Meta for Developers.
- I’ve configured the app with the necessary Instagram permissions.
- The app has been reviewed and approved by Meta.
- I’ve verified the generated tokens using the Token Debugger tool, and they are associated with the correct Business app.
My Question
Despite these steps, I’m still unsure if my implementation is fully future-proof for the Instagram Graph API.
- Am I missing any critical steps or considerations here?
- Should I be worried about the short-lived token generation endpoint?
- Why isn’t
graph.instagram.com
listed in the Graph API Explorer, and should I switch tograph.facebook.com
for Instagram API calls?
Any guidance or clarification would be greatly appreciated!