I am trying to show instagram feed(of a specific account) on website using the developer documentation at https://developers.facebook.com/docs/instagram-basic-display-api/getting-started . instagram-basic-display-api seems supporting "Getting an Instagram user’s images, videos, and albums".
Manually through browser I could get the Authorization code by clicking "Authorize" in the Authorization Window. But it's mentioned in the post that "Authorization codes are short-lived and are only valid for 1 hour.". And hence I couldn't reuse the same authorization code for all the requests and every hour I need to generate a new one. Is there a way or javascript sdk that allows to make the request through code(javascript) to generate authorization code without Authorization Window?
The Instagram Basic Display API allows users of your app to get basic profile information, photos, and videos in their Instagram accounts. The API can be used to access any type of Instagram account but only provides read-access to basic data.
Go to Dashboard, scroll down, locate the Instagram product, and click Set Up to add it to your app. Click Basic Display, scroll to the bottom of the page, then click Create New App. In the form that appears, complete each section using the guidelines below.
If you are building an app for consumers or you only need to get an app user's basic profile information, photos, and videos, consider the Instagram Basic Display API instead. The API is built on the Facebook Graph API.
Facebook will let you generate a CODE through the browser (GET). Then you will need to exchange mentioned CODE for a TOKEN, but now through cURL request (you can use POSTMAN, for example). as in Step 5: https://developers.facebook.com/docs/instagram-basic-display-api/getting-started
If you're using Postman, make sure you put the required parameters in the body as x-www-form-urlencoded.
After Step 5 you may receive an access_token, which you will then be able to query the user. It's a short-lived TOKEN.
As for your question, you would then be able to exchange this short-lived token for a long-lived one, as in https://developers.facebook.com/docs/instagram-basic-display-api/guides/long-lived-access-tokens.
But there are some caveats:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With