Business Facebook page id? - facebook-graph-api

I'm tring to find the Facebook ID for my business page to use with Open Graph. I have claimed my url so I can't see the id
when I enter:
graph.facebook.com/StagecoachWineTours
I get the response:
false
Is there another way?

Your ID appears to be: 97122673369
I got it by visiting the following link:
http://developers.facebook.com/tools/explorer/?method=GET&path=StagecoachWineTours
If it is still showing up as 'false' when you reach it you'll need to click on Get Access Token. After that a dialog will appear, click on Get Access Token once more. Once you have done this click on submit.
The reason you could not retrieve your info appears to be because you need to provide an access token on your Graph API call to fetch it. Once you do that you'll be able to get all sorts of info!

Related

How to get a valid access token to query search result from Facebook graph API

I want to collect all the Facebook link from Facebook search function. What I'm using here is the Facebook graph API tool.
If I want to query the data for a keyword, for example: "limited";
I will use the URL:
https://graph.facebook.com/v11.0/search?q=limited&access_token={my_access_token}
My image
However, I got the result as in the image. When I tried to create a workplace app and tried to get the access token of that app, I got the message as in the second image.
Error message when getting the access token of a workplace app
What I need now is an access token that has the permission to retrieve the data from the Facebook search. After that, I can use python to handle the rest.
Please help me out, thank you very much!

Never Expiring Facebook Page Access Token

I have been trying to find a way to create a never expiring FaceBook Page Access Token. I have seen the option where you provide the AppID|AppSecret in place of the token however that requires you to submit the app for approval and facebook does not seem to understand concept of OTHER apps using the token. Regardless, see the answer below for how I found a way to do this.
After piecing together many different solutions - I did this and it seems to work. I assume you only want a token for a single page and that you already have your Facebook app page setup.
Get the ID of the page by navigating to it from a web browser, click on About link in the menu list down the left hand side of the page, then scroll to the bottom of the About information and you will see the Page ID display.
Navigate to Facebook Graph API Explorer
Remove everything after the API Version (in this case v3.2) on this line of the explorer
and replace it with 123456789?fields=access_token where 123456789 is your page ID.
Click the Submit button to the right hand side of the line you just entered the text into.
You will receive a token back in the response at the bottom of the screen that looks similar to this:
{
"access_token": "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT",
"id": "1755746091324056"
}
where TTTTTTTT is your access token.
Copy the token only (no quotes) out of the response and past it in the Access Token field at the top of the Page replacing the Access Token that was previously there.
After pasting in the new access token click on the blue information icon to the left of the access token.
In the Access Token Information dialog, click on the 'Open in Access Token Tool' button at the bottom right of the dialog.
In the Access Token Debugger that will open up, click on the 'Extend Access Token' button at the bottom of the page. A new access token should be displayed and the text above it should say that it never expires.
I hope this helps.
PS - Here is what I see in Facebook's Access Token tool when I paste the token generated using this method into it. It says this token will never expire.

Facebook Graph API - get event attending list

I have a page that acts as the admin of various events. I am attempting to retrieve a list of people who have RSVPed as attending.
I used to be able to access this list with the following, where the access token was generated by an app I created:
FB.api(
'/{event-id}/attending',
'GET',
{'access_token':{access-token}},
function(response) {
// Insert your code here
}
);
This now results in a permission error.
I've used the explorer to try generating different types of access tokens, but all I can get from that edge now is an empty data object.
I've read that permissions errors will fail silently in this manner, but I can't figure out what permissions I need to retrieve this data. Even when I use an access token from the page (which is listed as an event admin), I come up with nothing.
It is no longer possible to get the attendees:
https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#events-4-4
GET /events — You can no longer get the following edges:
attending
comments
declined
feed
interested
live_videos
maybe
noreply
photos
pictures
posts
videos

Graph API Javascript bug

Recently I am experiencing this problem.
When I click to register with facebook and I am logged in as a user, I can see my information correctly. But staying on the same page, if I log out from facebook in some other tab and click Register with facebook on my own site, I see this person profile picture. The url of this image is:
http://graph.facebook.com/undefined/picture?type=large
I am accessing graph API using APP
Kindly advise me the solution to the problem
Accessing a users data requires an access token, with out this token your call is getting undefined returned as a user, and with out the access token appended to the picture url it returns emphamous Unknown User.
refer to: http://developers.facebook.com/docs/facebook-login/access-tokens/
for requesting access tokens, and usage.
Example Only: https://graph.facebook.com/ShawnsSpace/picture?type=large&return_ssl_resources=1&access_token=users_access_token
My script cannot access FB script without Access token
FB.login(function(response)
{
//If the user is succesfully authenticated, we execute some code to handle the freshly
//logged in user, if not, we do nothing
if (response.authResponse)
{
FB.api('/me', function(response) {}
}
{scope:'email,user_events,friends_photos,user_about_me,user_birthday,user_hometown,user_location,user_location,user_relationships'}); });//fbclick
So, I think access token condition is already satisfied.

Application Token is Different

On this page:
http://developers.facebook.com/docs/opengraph/using-app-tokens/
It describes how to get the app access token, yet the token it returns is different than the one in the open Graph "Get Code" example. The latter is the only one that works. How can I get the second access token using the API? When I try to use the first example, I basically get something back that looks like "application ID|secret key" which is different than the real access token.
as documentation states, you will get
access_token=YOUR_APP_ACCESS_TOKEN
string back from the API call. Even though it LOOKS like "application ID|secret key HASH" - it is a valid access token you can use to publish to user's wall. You can verify it's a proper access token using Debug toll from FB: https://developers.facebook.com/tools/debug - just paste the token there.
The reason it might not work for you is because you are trying to publish something to the user's wall who did not authorize your app. Look here: https://developers.facebook.com/docs/reference/javascript/ - for example of how to use your app ID to make user authorize the app. You need to request publish_stream permission for your app from user in order to be able to publish as the app to the user's wall.
And going back to the documentation:
Note that the app access token is for publishing purposes permitted by
the publish_actions and publish_stream permissions. You will be unable
to retrieve information about the status update post with the given ID
using the app access token. Instead, you should use a user access
token for such purposes.
hope that helps.