facebook developer authenticate instagram test user - facebook

I'm trying to display my instagram feed on my website. I'm going through the facebook developer tutorial here: https://developers.facebook.com/docs/instagram-basic-display-api/getting-started
I'm not understanding step 4: authenticate the test user. When it says construct the authorization window url, does that mean create a web page with the:
https://api.instagram.com/oauth/authorize
?client_id={app-id}
&redirect_uri={redirect-uri}
&scope=user_profile,user_media
&response_type=code
Is that supposed to be in a javascript or what?

Related

How to get Instagram direct API authentication

Facebook recently released a step-by-step documentation for using a GrapAPI to manage Instagram messages. To obtain the access token to use it, it's necessary to create an application in the developer center, enable login via Facebook and include the permissions "instagram_basic", "instagram_manage_messages" and "pages_manage_metadata" but to activate these options it's necessary to submit various information for approval as statement of how the integration works and descriptions of the usage flow. I don't have access to this information because I can't develop an integration without it being approved.
It's not possible to use the provided test user as the pages raised by him cannot be linked to Instagram accounts.
Tutorial followed: https://developers.facebook.com/docs/messenger-platform/instagram/get-started
Someone with some experience with the Facebook API could give me a light on how to obtain the token with access required and proceed the tests?
I have done the tutorial as well, I faced the same problem. To enable instagram_basic, instagram_manage_messages and pages_manage_metadata without app review you need to create a test-app. For test apps all permissions are granted without review.
Instructions on how to create a test-app
Another usefull tipp: If you are wondering why you need to implement facebook login to access the instagram messaging api, the logic is the following: You need to implement login to then use your own implementation to logg in your own account and obtain the page access key that will let you do api calls to the instagram messaging api. This process is obviously overkill and instagram is working on a way of getting that access token through the developer dashboard.
For now to obtain that access token you need:
implement facebook login as a simple html website and console log the response. Be sure to add the required permissions to the data-scope attribute of the facebook login button:
<div
class="fb-login-button"
data-scope="public_profile,email,instagram_basic,instagram_manage_messages,pages_manage_metadata,pages_messaging"
></div>
deploy to a website that has https enabled (logging in from
localhost will only work if you use a tunelling service like ngrok).
Open your website that has facebook login implemented and logg in with your facebook account that is also linked to the target instagram account and also is admin of your test-app.
get the access token from the response to call the other API endpoints.

How to get Facebook comments for a page on my website

I can use Facebook login to login as an admin of the Facebook app that represents my website. Then, I can call this endpoint:
"https://graph.facebook.com/comments/?access_token=".$tokens["access_token"]."&ids=".$source
here, $tokens["access_token"] is an access token provided by the Facebook login process and $source is the URL for which I want to get the comments.
Facebook's API response is this:
To use 'Page Public Content Access', your use of this endpoint must be
reviewed and approved by Facebook. To submit this 'Page Public Content
Access' feature for review please read our documentation on reviewable
features: https://developers.facebook.com/docs/apps/review.
Initiating the review process for my app in the Facebook developer dashboard, the requirement for obtaining access for this is:
Please give them detailed step-by-step instructions for how to see
this permission the same way people using your app would.
And:
We need to see your app using Page Public Content Access so we can
see that it doesn't violate our policies. Upload a video screencast walkthrough using any method, (even recording with your
phone).
(In both cases, the emphasis is mine.)
I can not show what I can not show. I have no access to this endpoint, so I can not show, in action, my site using this endpoint.
What's more, I am the admin of the Facebook app representing the website for which I want to get access to the comments, and want to access the comments through that, my, account, only; I don't want any regular user account to access the comments for the pages on my website.
So, how do I get programmatic access to the Facebook comments made on pages on my website?

Link facebook messenger with facebook login on app

I have a facebook messenger bot that sends a webhook to my web app. People can login to my app via facebook login.
The first user contact is normally with my facebook bot on which they can create a profile. When they make contact I take their facebook id, name, profile pic, etc.
Users can then login with facebook to my web app to enhance their profile.
My problem is facebook uses different scoped ids for messenger and their login.
How can I recognise if a user has already been on my facebook bot if they use my web app, and vice verca.
I think it has something to do with the business mapping api: https://developers.facebook.com/docs/apps/for-business but I'm struggling to understand how it works.
I am sending a get request using:
GET /me?fields=token_for_business
But the docs do not specify the full url to use. I'm also unsure if you can use this in developer mode.
facebook provides an id-matching api
for the app and pages owned by the same business manager. More informations:
https://developers.facebook.com/docs/messenger-platform/identity/id-matching

C# Facebook sdk: posting on page on owner's behalf

I have a page on facebook and i want to get my page access token so that i could use it to post ob my page from a mobile application or web application using the facebook sdk for C#.
I think the whole idea would be:
user will go to my webpage.
user will then login to facebook.
user will be taken back to my page with the his page's access token.
i will save this access token and then use it to post on his page on his behalf.
Right now i am not sure whether these are the right steps or not and if i am right, how can i make a facebook login page where user can use?
EDIT:
I found some answer here: Programatically log in to facebook and post from server side
do i need to create a facebook app for that?

Facebook Place search with Graph API

Is it possible to search Facebook using the Graph API without having the user log in? I specifically want to search for Places, but I notice with the example on Facebook's Developers site they include an access token in the URL, which I believe is generated by having the user log in.
Here's a relevant link describing the API: http://developers.facebook.com/docs/reference/api/
After some more searching, I found the "App Login" section of the Authentication page of the Facebook Developers site.
More info here (scroll down to the App login section): Facebook Authentication
Using App Login, you can retrieve an access token using your application ID and your app secret, and then use that access token to perform Place searches. This avoids requiring any user interaction.