Getting feeds from Facebook groups using Graph API HTTP requests - facebook

I would like to integrate my APP with some existing groups in Facebook.
So, for that, I would like to be able to read people's posts.
I have tried the following HTTP request to Facebook's graph API:
http://graph.facebook.com/v2.5/192992880732335
But it responds with the following:
{
"error": {
"message": "An access token is required to request this resource.",
"type": "OAuthException",
"code": 104,
"fbtrace_id": "By+n1YSvvrI"
}
}
How can I get an access token to a specific group?

It is pretty ease to get all the feeds from that group.
Just add the access token from some user and your are done:
https://graph.facebook.com/v2.5/192992880732335/feed?access_token=<ACCESS TOKEN>
To get the access token, it is just a matter of calling
FB.getAuthResponse().accessToken
after user's login.

Related

Facebook graph not give me access for content although I am a group administrator

My web-application need to fetch posts from facebook and save content in pages.
I'm have developer account with business access (authomatically contains permissions pages_read_engagement).
I'm try to get API-key by request: https://graph.facebook.com/v8.0/oauth/access_token?grant_type=client_credentials&client_id=****&client_secret=***
API return me access token and token type:
{
"access_token": "|", "token_type": "bearer" }
After that i try to get feeds via request: https://graph.facebook.com/APP_ID/feed?fields=is_published,id,attachments{title},message,created_time,full_picture&access_token=***&appsecret_proof=***
But API return me error:
"error": {
"message": "(#10) This endpoint requires the 'pages_read_user_content' 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.",
"type": "OAuthException",
"code": 10,
"fbtrace_id": "AbApv_PjRlplW2Abv61zNCx" } }
I'm trying to get a long-lived user access token, and it worked correctly, but only 60 days and blocked, Then I have to restore it manually.
Account with API is administrator of group and Page read content should work
Support replied that the rights pages_read_engagement will be enough, recommended to change the API version to 10.0, but it did not help. What am I doing wrong?
I tried to use the app key, but it does not work, you need to use the user access token (which has restrictions), or create a system user (which no longer has such restrictions)
I'm create the system user and use his API key.

Why does facebook’s graph API return a permissions error when I try to get the “owner” of any facebook event that I am personally invited to?

I am using facebook's graph api. The access token I am using is the User's access token, (my personal access token). I am invited to these events personally. These events are public.
When I type /{eventid}/?fields=owner, I get
{
"error": {
"message": "(#200) Permissions error",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "DcJaHySwF7S"
}
}
When I do /{eventid}/?fields=cover or most other fields it works just fine.
I am using the online graph tool v3.3 and tried it on v3.2 as well.
I have also tried this on curl on my personal terminal.
Below is the oath permissions I have set using the Graph API explorer.
Permission's Image
Since you cannot even get the list of Page Events right now (even if you own the Page), I assume it´s not possible: https://developers.facebook.com/docs/graph-api/reference/page/events/
This is a restricted edge. You cannot request access at this time.

Facebook Business page - Unsupported get request

I have admin access to a Business Facebook page, I created an app under the same account, when I then try to use the Graph API Explorer under that application using the access token generated I get:
get/v2.5/{client-name}/
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
I have full access so I do not know why I am getting a error. This normally works fine when I try it on a standard Facebook page, is there something extra I need to do for Business pages?
Since you are trying with an App Token, i assume that the Page is restricted by age or location. In that case, you have to use a User Token or Page Token of a user who is allowed to see the Page and its content.
More information about Tokens:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/

Getting videos uploaded by facebook page without requiring user to log in

I'm trying to get videos of facebook page using facebook graph api.
I get it to work when I use my personal access facebook accounts access token but if I try to use my apps token it returns
{
"error": {
"message": "A user access token is required to request this resource.",
"type": "OAuthException",
"code": 102
}
}
Is there way to get pages public videos from the api by using app token?
If not, is there way to use just my personal access token and renewing it automatically without requiring the user to login. (Server would always make the request with MY OWN access token, not their)

How to get statuses of a random facebook page through Graph API

I'm trying to get the statuses of a facebook page. For this I need an access token, which I can obtain by this:
https://graph.facebook.com/oauth/access_token?
client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&
grant_type=client_credentials
(Found here)
But when I try to access the graph api manually, with the access token, like this: https://graph.facebook.com/id_of_page/statuses?access_token=my_fresh_access_token, I always get this error:
{
"error": {
"message": "A user access token is required to request this resource.",
"type": "OAuthException",
"code": 102
}
}
Are there different 'kinds' of access tokens? Or what am I doing wrong?
There are several access tokens on Facebook.
The access token you are receiving is an app access token which is more limited than the user access token.
The access tokens available are explained here under 'Access Token terminology': https://developers.facebook.com/docs/authentication/permissions/