It can be long to find the way through the documentation for these simple steps, so here is a shortcut.
Go to https://www.instagram.com/developer/clients/manage/ and get a Client ID and Client Secret.
- Start a local server
php -S localhost:8000
- Start Ngrok and get the forwarding url
(e.g. http://my.ngrok.io)./ngrok http 8000
- Copy this url into the security tab from the Instagram ui
- Get the code
Access this url from the browser:
https://www.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=http://my.ngrok.io&response_type=code
it will redirect then to http://my.ngrok.io/?code=CODE
- Get the access token
curl -F 'client_id=CLIENT-ID' \ -F 'client_secret=CLIENT-SECRET' \ -F 'grant_type=authorization_code' \ -F 'redirect_uri=http://my.ngrok.io' \ -F 'code=CODE' \ https://api.instagram.com/oauth/access_token
Documentation
- Instagram: https://www.instagram.com/developer/authentication/
- Ngrok: https://dashboard.ngrok.com/get-started
Add new comment