Search code examples
oauthfacebook-logininstagram-apiinstagram-graph-apireact-native-instagram-login

How to use instagram API for Login


I have been trying to implement the OAuth flow for Instagram login with Instagram official APIs but seems like a lot has changed since June 2020 and I haven't had any luck to get any help for the Instagram Oauth login flow that can return a user email which can later be used to keep track of the user registration via Instagram API.

Instagram official documentation says that they don't recommend using Instagram Basic Display API for login here: https://developers.facebook.com/docs/instagram-basic-display-api

Can someone guide me on how to get the user information like email or at least username in return from the Instagram API.

Any help will be highly appreciated. Thanks


Solution

  • It is not possible to get an email from Basic Display API. You will not be able to get the email from the API responses. You can get the user ID from Instagram when you will exchange the code obtained via Authenticate to access token. Later on when you will have the valid access token you can get the username. I would recommend checking out Getting Started from that API: https://developers.facebook.com/docs/instagram-basic-display-api/getting-started it shows how to get user_id (step 5) and username (step 6).