How can I access offers of a public page via facebook graph api? - facebook

The documentation on endpoint /{page-id}/nativeoffers clearly states that we need the page-id and pages_manage_ads permissions to access offers on a public page. Also the person who requested the token should have ADVERTISE role on page. Here is the link to the documentation of graph API.
Current Situation
I have the pages_manage_ads permission on specific user_token.
The user is admin of the facebook page and have role in developer console app too.
The app is yet in development mode.
Problem:
When I try to access the offers of the page using the endpoint /{page-id}/nativeoffers, it returns me empty data despite the fact that offers are present on the page I am trying to access.
Anyone who can help me with this?

Related

facebook leads retrieval issue using graph api

Getting the following error while retrieving leads through graph api using form id. The same end point works fine for other users, but its not working for one of the users of the app. Not sure why its happening. Is there anything related to account type on facebook?
(#10) This endpoint requires the 'pages_read_engagement' permission or the 'Page Public Content Access' feature. Refer to https://developers.facebook.com/docs/apps/review/login-permissions#manage-pages and https://developers.facebook.com/docs/apps/review/feature#reference-PAGES_ACCESS for details.
https://graph.facebook.com/v9.0/<form_id>/leads?access_token=<>&appsecret_proof=<>
After adding pages_read_engagement in the scope list and making the user reauthorize the app the said api call is working fine but my query is why did it work for others.
The user does not have any role. User is following oAuth to permit the app to access his facebook pages and ad data

Using Instagram Graph Api with permanent page access token only works for some accounts

I try to fetch some images from an instagram business account through the instagram graph api by means of a permanent page access token (facebook: permanent Page Access Token?). These specific tokens seem to be the only possibility to get permanent access to the graph api for a server-side app.
On the other side I found a hint in the fb documentation that only user accesss tokens can be used to access instagram business accounts.
"Page access tokens are not supported."
https://developers.facebook.com/docs/instagram-api/overview/?locale=en_US
Funny enough I was using page tokens so far without any problems. After resetting the database of my project and generating new tokens I observered that some accounts weren't able to fetch the data while others had no problems.
"Unsupported get request. Object with ID 'XXX' does not exist, cannot be loaded due to missing permissions, or does not support this operation."
I had 2 instagram accounts: 1 was working with page access tokens the other didn't. So, I checked it in the fb graph explorer. Using the user access token I have no problem with both accounts. Using the page access token respectivly for both accounts one is working fine for the query while the other isn't. A third account that I created has the same problem.
Things I tried to resolve the issue:
deleting all permanent page access tokens from my database and generate them again
generate the permanent page access tokens manually by means of the fb graph explorer tool
turn my instagram account back into personal and then again into a business account through the app
turn my instagram account back into personal and then again into a business account through the facebook page
create a new instagram account and a new facebook page to connect (repeating 3. and 4.)
My questions now:
Can I use permanent page access tokens for the instagram graph api?
If not, how do I get permanent server side access to the instagram graph api?
I am now searching the internet and stackoverflow for days and getting crazy because I seem to be the only person experiencing this problem. So, help will be highly appreciated by my fellow developers. Tia.
Since yesterday everything works fine again also when using the permanent page access token. Seems like fb resolved an internal bug. However, the question remains, if page access token can be used in general or if it is just a bug itself.

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?

No access token facebook application authentication

I'd like to show my facebook wall posts on my website.
So i don't want to authenticate users with a dialog, to grant them some rights, i just want to show him my wall with comments (no ability to add comment just read only access).
As i know there isn't unexpired tokens now so is it possible to access just my data without requesting token every time it expires?
I'm using asp.net mvc but i think this sultion doesn't depend at platform at all.
You should:
Make your Facebook Posts public
Call the API endpoint: https://graph.facebook.com/{your_id}/feed?access_token={app_access_token} with your user_id and valid application access_token
Show the results on your website.
The App Access Token doesn't expire so you won't have a problem. As long as the posts are public, the API will be able to pick them up. In theory, your posts should be public anyway so anonymous users can see this.
This also gives you the ability to share stuff privately and not have it show up on your website.

How to get the access_token for Facebook with no application

On the documentation page for Facebook Graph API there are a lot of example links such as https://graph.facebook.com/me/likes?access_token=SOME_AT
Could anyone explain how the access_token for these links are generated?
All I've read in the documentation were about getting access_token only for applications, but on that page everyone could get an access_token without one.
You can use the graph API to get public information. People set privacy settings on facebook, so to prevent social freaks from stalking you, they(fb) created Autorisation.What I believe is that on the documentation, they are generating the access token using the Developers App. You can generate this Access token by making an application and asking a user to Authorise your application to access his data using OAUTH dialogs. Usually people reading at developer.facebook.com have enabled the Developers app so it easily opens your information.
The Graph API as such allows you to
easily access all public information
about an object. For example,
https://graph.facebook.com/btaylor
(Bret Taylor) returns all the public
information about Bret. For example a
user's first name, last name and
profile picture are publicly
available.
To get additional information about a
user, you must first get their
permission. At a high level, you need
to get an access token for the
Facebook user. After you obtain the
access token for the user, you can
perform authorized requests on behalf
of that user by including the access
token in your Graph API requests:
The access_token in these links are generated using your Facebook identity and an application ID (presumable associated to "developers.facebook.com"). If you go to the same page with another Facebook account, you will see different access tokens.