I'm trying to get an access_token from Instagram to use their Basic Display API for a new app (simply display tweets on a webpage).
I followed these steps: https://developers.facebook.com/docs/instagram-basic-display-api/getting-started
But I'm stuck at Step 5: Exchange the Code for a Token
The cURL request always returns a 400 error with the message: "Matching code was not found or was already used"
However, after many tests, I got an access_token one time only, but it expired about one hour later. This seems to be very random.
The Instagram Basic Display API seems rather new. A while ago, I have used apps created on the https://www.instagram.com/developer/ website and it used to work. Now this site display this message:
UPDATE: Starting October 15, 2019, new client registration and permission review on Instagram API platform are discontinued in favor of the Instagram Basic Display API.
... with a link to the developers.facebook.com.
Go to the extensions' settings page [Ultimate Member > Settings > Extensions > Instagram Photos], enable the extension, select API type and paste API keys using the guidelines below. App ID - paste your Instagram App ID displayed in [App Dashboard > Products > Instagram > Basic Display].
In 2018, Instagram shut down its public API. Meaning, third-party apps can no longer access the API from Instagram without permission. Third-party apps now need to be approved by Instagram before they can access the API.
I tried using the command-line tool as per the original docs(https://developers.facebook.com/docs/instagram-basic-display-api/getting-started), but no luck...
Here's what to do in 3 easy steps:
https://api.instagram.com/oauth/access_token
with the parameters in the body, NOT the params. Make sure that the x-www-form-urlencoded
option is enable.200 OK
and a response with both access_token
and user_id
.{
"access_token": "IGQVJYUXlDN...",
"user_id": 17841400...
}
Happy days!!
See the screenshot for the correct settings:
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