not able to get album images from a public album in facebook - facebook

I am trying to return all images from a public album and getting this error.
{
"error": {
"message": "Unsupported get request. Object with ID 'TestAlbumOne' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"fbtrace_id": "Ed/iDn/aAVd"
}
}
Which makes no sense since the album does exist and its set to be public. The documentation is also a bit vague since it doesn't really mention anything about the access token in the request url which I did find after some research. Am I missing something here?
request url:
https://graph.facebook.com/v2.8/TestAlbumOne/photos?access_token={'my access token'}
And thats what I see on the facebook album, which does say its a public album

It looks like you are trying to get the public album of a user account, which is impossible without authorizing that specific user with the user_photos permission. Just because stuff is public on facebook.com does not mean you can (or are allowed to) grab it with the API.
Authorize the user with user_photos and use the User Token.
About Tokens in general:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/
About user authorization:
https://developers.facebook.com/docs/facebook-login

Related

Fetch public photo sources from my facebook page

I'm trying to fetch the public photos I've posted on my facebook page.
With that, I plan to make a caroussel on my website that displays the photos I posted on my facebook page.
Using the facebook Graph API, I ended up with this:
my-page?fields=albums.fields(photos.fields(source))
The thing is that the response I get is:
{
"error": {
"message": "(#10) 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.",
"type": "OAuthException",
"code": 10,
"fbtrace_id": "DxhgQ12ym3r"
}
}
I've tried to get the app reviewed, but at certain point they ask me to attach a video in which I show how the final user will use the app. But this is a server-to-server app, so I don't understand how am I supposed to answer that petition.
I've also tried to get a page access token, but I get the following error:
Invalid Scopes: manage_pages. This message is only shown to developers. Users of your app will ignore these permissions if present. Please read the documentation for valid permissions at: https://developers.facebook.com/docs/facebook-login/permissions
I'm quite lost, if anyone could guide me a bit or explain me step by step how to reach my goal...

Facebook: get event information for public page

My Facebook page publishes public events and I am developing an app that uses this page. I want to get the number of interested/going people for a specific event given its Facebook id.
I, the creator of the app, am also the admin of the page. However, using my app access token that I generated with the app id and the app secret, I can't call the event API: https://graph.facebook.com/v3.0/137340177139954?access_token={access_token}
I get the following error
{
"error": {
"message": "Unsupported get request. Object with ID '137340177139954' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "FqJ5oAqdukA"
}
}
What am I doing wrong? How do I get event information about a page that I own
The endpoint that you're hitting is not correct. You're forgetting the /events portion after your page_id.
This is what it should look like:
https://graph.facebook.com/v3.0/137340177139954/events?access_token={access_token}

Viewing graph api via url not showing data

So I have been watching some tutorials about the facebook graph API, and one of the things in the video is to simply navigate to http://graph.facebook.com/youtube
and it should display a json response of their facebook likes etc. This is said to work without an access token?
But this doesn't seem to work, i get the following response -
{
"error": {
"message": "An access token is required to request this resource.",
"type": "OAuthException",
"code": 104,
"fbtrace_id": "DoY144sSuti"
}
}
Has something changed that you will need to always need an access token just to see peoples data, eg how many likes a page has?
Has something changed that you will need to always need an access token just to see peoples data, eg how many likes a page has?
Yes. Since API v2.0, all API calls (with the profile picture redirect being the exception) need to use an access token.
Public data about public pages can be accessed using an app access token; if the page is not public it needs a user access token for a user that can see the page, or a page access token. (More about the different types of token here: https://developers.facebook.com/docs/facebook-login/access-tokens)
This is said to work without an access token?
Then that tutorial is simply outdated.
Yes you will need the access token in order to view that Jason data in URL .
try this Instead :
https://graph.facebook.com/page-id/posts?access_token={your-access- token}
You will be able to see the posts now.Hope this would help you .

App access token, can't get user information

When I try to use the already generated access token, on this https://graph.facebook.com/4921782178422?fields=id&access_token=ACCESS_TOKEN, it gives me this in response:
{
"error": {
"message": "Unsupported get request. Object with ID '4921782178422' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"fbtrace_id": "F2ot2MGcBBM"
}
}
Facebook writes that all access tokens have permissions to public_profile, but i can't use the link above.
4921782178422 is a user id.
It works fine, when I use my own user access token, but that's only valid for 1 hour, and I need it longer than that.
I have followed these steps:
facebook: permanent Page Access Token?
What do I do wrong?

App Scoped Id - Link to Facebook URL

Previously - we were able to use the /account_id?acesss_token=APP_ACCESS_TOKEN to get the users information that authed in your app.
For the new v2.0 API, we get app_scoped_id where the folllowing method:
https://graph.facebook.com/v2.0/APP_SCOPED_ID?access_token=APP_ACCESS_TOKEN
Works for some users, but others - we get this:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
Why would this function work for some users, but not others? We have no way to get the link property of the user to redirect them, nor does http:///facebook.com/SCOPED_APP_ID do anything or http://facebook.com/app_scoped_user_id/SCOPED_APP_ID work correctly. Anyone have advice to redirect the user to their FB profile via the FB Scope App ID?