Migrating existing Login flow using Instagram Legacy API to the new Instagram Basic graph API - facebook-graph-api

Our application (kind-of got legacy) has been using IG API to authorize users (by using the uid attribute returned from IG's callback API response) and we have left email as an optional param (safe to assume that there are many users in the application database without email IDs persisted)
With new Instagram Basic Display API (advised), it's mentioned to use Facebook Login for authentication purpose. But I am facing a major problem of identifying existing users now (since the uid will be different).
Also I have a doubt on what will have happen for users having instagram account without linking their Facebook account to it?
I could not find a proper explanation or a documentation for seamless migration for my situation.
Please help with sharing the right resource or guidance to achieve the same.

Related

Requirements for Instagram Graph API testing and development

I'm trying to build a prototype which collects and analyses comments from Instagram. This can seemingly only be done with the Instagram Graph API. So to prototype and test I need:
A business IG account connected to a Facebook account (the account to access and read the comments of)
A Facebook App configured to access IG accounts (the account/app which gets authenticated to access the IG account)
However, this App needs to go through a verification process for each of the permissions required. The process apparently takes up to 5 days and needs a Privacy Policy on a website (neither of which I have yet).
This is a lot to do considering it is just a prototype/PoC to establish feasability and get better acquainted with using/testing the API and data.
Does anyone with experience working with the Instagram Graph API know whether I am over-thinking or misread what is required here? Or do you have to go through this before being able to access IG account comments?

Parse-Server Facebook login - link users with Business Mapping API?

I'm Using ParseServer with two different client applications. Since each mobile app is associated with a different Facebook app (different app names, logos...), the current Facebook policy is to issue a foreign user id for same users when authenticating through different Facebook apps.
We'd like to link those two user ids in ParseServer so they will share a single user account. Even when authenticating via different Facebook apps.
According to Facebook documentation the way to do that is by using the token_for_business or "Business Mapping API" to match two user IDs that belong to a single user.
However, ParseServer documentation does not indicate how to use token_for_business or "Business Mapping API".
We are currently using the /users (POST) endpoint for login and registration passing the authData structure for Facebook when Facebook auth is performed.
Assuming ParseServer uses the authData.facebook.id attribute in order to look for existing users once a new login request arrives, its possible to call the facebook API GET /me/ids_for_business and substitute the id in authData with a previously existing user id.
Is this a recommended approach?
Ideally, I'd like to just add my token_for_business to the authData in the login request and have Parse do the rest of the work. Is that supported?
Lastly, is it at all possible to link two facebook users in ParseServer? the authData structure does not seem to allow is as the "facebook" id section is no in any type of array - it seems there is no way to express dual facebook ids under a single user.. Is this changed at any future parse version (currently using Parse 1.6.14 in the client and ParseServer 2.2.19)
Thanks,
Ron

How to read Facebook Insights for a Native/Desktop app programmatically

Unfortunately I'm struggling to understand the documentation provided by Facebook.
This is the scenario:
- Some of my iPhone Apps are also registered as Native/Desktop Apps on Facebook in order to support the Facebook Audience Network.
- I'm building a tool in python which will retrieve data from the reporting API in order to run some automated analysis on specific metrics (request, impressions and so on).
The question is: how do I retrieve this data?
The documentation for the reporting API is here: Reporting API
However I'm struggling with the access token.
It says that I could use the specific App Token available here: App Tokens
However by using such token, I get an error saying that app tokens can't be used for Desktop/Native Ads.
What is the correct way to do it then? Here is where I struggle to understand Facebook Documentation.
My guess is that I should use a User Access Token instead, generated for a user that is also the admin of the App for which I want to retrieve the insights.
What really freaks me out is that apparently, this can't be done with normal HTTP calls only but it requires instead to go through the Facebook Login Dialog. I also need to create another Facebook (web) app because there is no way to get a simple "User Object"... Everything needs to start and go through a registered Facebook App. And there's no way to go through these steps by using backend code only.
So... to recap... in order to read the Insights for a Native/Desktop Facebook App (APP_A), I have to:
- Create a new Web Facebook App (APP_B)
- Create a web interface somewhere for APP_B) which will trigger the Facebook Login Dialog and request the read_insights permission.
- Login through this web interface and generate a User Access Token
- Put this User Access Token in my backend code and run the scripts that retrieve the data provided by the Reporting API for APP_B
Really... to me... it doesn't make any sense to create a new Facebook App in order to access the data of another Facebook App.
Isn't there another better, simpler, quicker, cleaner way to achieve the same final result?

Instagram API Pulling Images Without Authorization Page

So I was going through Instagram's API and I implemented it. However it isn't as useful as I thought it would be because when trying to get and OAuth2 token a user is taken to a page to authorize them in what looks to be and effort of insuring that the user realizes that they are about to view and share Instagram content with my application. This all makes sense to me although not ideal. You can find it in detail here(Step One: Direct your user to our authorization URL).
Then I saw this press release from a company called Celtra who says they can pull the the most recent images off any Instagram feed and put them in an Ad. I checked it out and somehow they are pulling the images of other companies without this authorization page I am encountering. Basically without page scrapping I don't know how to do this with Instagrams API, and I realize scraping violates Instagrams terms of service. Does anyone have this functionality, where I can pull down images from Instagram and not take a user to an authentication page working legally as I am assuming Celtra is doing? Guidance or documentation on how to achieve this would be ideal.
Instagram recently added an endpoint that will allow you to any instagram account's photos without oauth or needing access_token, you can specify client_id and make API call to get photos.
Just register for an app account at here and add the client_id to this endpoint and make call:
https://api.instagram.com/v1/users/3/media/recent/?client_id=YOUR-CLIENT_ID
You only need access_token to get users' likes, follower feed and to like/comment/follow.
update: you need to have access_token with the new API changes, cannot
access API with just client_id anymore
To do this simply, you could authenticate your app from a dummy profile or your own personal profile and then use the access_token to request the feeds of any account. Then, when an end user goes to use your product, instead of authenticating them, you can just pull content from the Instagram API using your access_token.

Facebook Integration Static access token

I'm trying to use the facebook API on the backend of a website. Essentially, I want to be able to create events using a Djano app and have it create the corresponding facebook events.
The organization I am creating events for already have a facebook page. I only am concerned with posting events on that organization's page. I am the admin for the organization so I know all the login info.
What I am am trying to figure out is how I can setup the access token such thatit just works for the organization without any need to login to the facebook app. I was thinking that setting a static access token would do the trick, but I cannot find anyway to do it.
So, what is the standard way to create a facebook app that only interfaces with one predefined user?
Im not entirely sure what you're trying to do. However the static access token has now been deprecated. Do you want to: create an event for the person using the page, or for the company's page/profile?
Hope I can help