How can i fetch data with group page alias ?
Take for example this group: http://www.facebook.com/groups/toroneradio/.
Making request to https://graph.facebook.com/toroneradio gives me back:
"message": "(#803) Some of the aliases you requested do not exist: toroneradio"
Making request to the graph API with the group's id: https://graph.facebook.com/173246339390721 works OK.
It works great for pages though.
Looked at FQL groups table but name is not searchable. (FQL Groups table)
Also looked for some documentation and in FB bugtracking, couldn't find anything.
Is there way to get programaticly the group id from group alias or directly to get Group graph object?
Thanks, in advance!
The Easy Way
If you haven't done so, join the Facebook group which you want to fetch the group ID
Use the Facebook Graph API explorer
Access your list of groups via http://graph.facebook.com/me/groups
Search for the group and the ID will be listed in the object
If you are doing it through your Facebook application, all you need is to grab an FB access token before you do the FB Graph API call (read up the documentation here, especially the Authorization section)
The Hard Way
In case the easy way doesn't work (or if you feel iffy in joining the group), here's the sure-fire way to do so:
Start up Firebug and enable the "Net" tab
Bring up Facebook - check that the Net panl will show all the HTTP requests that's happening
Click the "Clear" button so that you have the panel in the blank slate
Click on the link of the Facebook group that you wanted to retrieve the Facebook ID
Look out for a GET request to generic.php - that would be the very first request, but hunt it down if it's not. Click on the [+] box to expand the details
Click on the "Parameters" tab and you'd see a key-value dictionary of the request. There'll be two fields in there called "key" and "sk", both of which would carry the same value like "group_1656399367890"
The group's ID will be the numeric value after "group_" (in this case, it'll be 1656399367890)
Hope that helps!
By using FQL:
SELECT id FROM profile WHERE username='groupname' AND type='group'
Just figured this out! Do this: http://graph.facebook.com/search?q=[ALIAS]&type=group
Related
I'm getting this error when sending some place_topics on an update request to the Facebook Graph API for a given Facebook Location Page.
{"error"=>{"message"=>"(#371) Some subcategories don't represent a place.", "type"=>"OAuthException", "code"=>371, "error_subcode"=>1721087, "fbtrace_id"=>"CIewiBZL+jf"}}
It is fixed by changing the category_id for another one. BTW, I would like to know if is there a way of knowing which categories are allowed and which ones doesn't. It would be nice to know it in advance to disallow some of the Facebook Categories in the editing process of our tool and avoid errors.
Thanks,
David.
Use search?type=placetopic&topic_filter=all in graph explorer to get list of valid place topics
I am working on capturing Facebook page, event and group feeds with the Graph API. It's for a research project for my master studies. With these lines in the Graph API Explorer
{page-id}/feed?fields=from,message,likes,comments,attachments
I can capture the most I need. But the responses on comments and the attachments in comments (like when someone uses images in his or her comment) are still missing. How can I get them with the Graph API Explorer? It would be greet if I can get them within the whole context of the feed, not just when typing in the specific comment-id in the Graph API Explorer. Is there any way to get the needed data?
As https://developers.facebook.com/docs/graph-api/reference/v2.7/object/comments#read explains, it depends on the filter modifier whether you only get the top-level comments (toplevel, default), or all comments including replies (stream)
So if you modify your request as follows, you will get comments and replies on them in one go:
{page-id}/feed?fields=from,message,likes,comments.filter(stream),attachments
^^^^^^^^^^^^^^^
But that will give you all comments on the same level in the data structure, so you won’t know which are replies – so you might want to request the parent property as well; for replies that holds the id of the parent comment. With
comments.filter(stream){parent,from,message,created_time}
you will also get the parent for comments that have one. (Once you’re asking for a specific field, you need to ask for the rest of the fields you want as well.)
I currently developed a solution for custom uploading videos for specific customers.
One of my customers need the ability to specify "interests" for a video he upload.
From the API documentation, interests are:
interests
list
One or more IDs of pages to target fans of pages.Use type of page to get possible IDs as find Targeting Options and use the returned id to specify.
There is some mis-documentation regarding this feature: "find Targeting Options" does not talks about type=page.
But, still, I can search for page, using the "search" endpoint: /2.5/search?q=gsw&type=page and get the ID of the page.
As to my understanding, I can specify a page, for example "Golden State Warriors" fan page, specify its id, and then every user which follows this page will be considered as interested in my post.
So, I think my flow should be:
1) Search for the requested page using the "search" api. Get the page's IDS.
2) When creating the video, specify the ID in the "interests" parameter list.
Now, I need to know how to specify the ID in the interests list - The documentation says it list, but the page ID as a number string...
So in conclusion, I would like some help in verifying that all that I have written is correct and make sense, and also to know how to get the int32 id of a page - is it just mistake in the documentaion?
Thanks!
I have a Facebook application, which I would like to be able to read facebook group feeds.
I have a user-input feed url, that looks like this: http://www.facebook.com/groups/music.sharing/
To access the feed though, I can only use its id, like this: http://graph.facebook.com/[id of group]/feed
I cannot find anything for that in the reference, FQL doesn't allow querying by name so .. I'm stuck. Any ideas ?
Thanks!
Its not possible right now, there are multiple open "bugs" and another stating the issue...
All the ways I have tried have failed... e.g. (below would work for pages)
fql?q=select id from profile where username='music.sharing'
We are facing this same problem on our current project. It is not an elegant solution that uses the API, but for now we will be using a workaround by scraping the HTML of the group landing page. The group ID number appears four times on this page in the html via links. The most reliable way to search for the ID is to search for "cid=" as it only appears once (right now, anyway) on the page (what follows cid= is the numerical ID). You'll see what I mean when you examine the html of a group page.
If you found a more efficient solution, I'd be grateful if you shared :)
A possible alternative until bug resolution could be: if you are asking your users for permissions then you can ask for the additional permission, user_groups, and then query graph api http://graph.facebook.com/[id of user]/groups. The returned data has group name, id, version, bookmark_order.
My Facebook Group Url is: http://www.facebook.com/groups/284064464943140/
I've read that the group ID is in the Url labelled "id=" or "groupid=" but assume this has changed since there is no such tag in my Url.
I would like to use the group id to insert a group feed into our group website.
Thank you
For finding any facebook group_id or page_id or user_id
go to inspect element of page and find these in meta tags.
Group Id
fb://group/Here_is_your_group_id
Profile user_id
fb://profile/here_is_your_user_id
Page Id
fb://page/here_is_your_page_id
try at http://lookup-id.com/ , get facebook id and group id
Try http://wallflux.com/facebook_id/, it will guide you through it,
If you need the id for more group for which you are admin, a faster method will be to use facebook's Graph Explorer tool. You need to get access token for 'user_groups' 'user_managed_groups' and make a request by adding groups field:
me?fields=groups
click submit. This will print all of the groups you are member of and corresponding IDs.
Update: Sorry folks, it seems that Facebook is pulling out the API for groups you don't manage. This whole topic might be obsolete.
You can look for post_form_id in the source code on Facebook but that is not always accurate.
For groups that do not have the ID in the Facebook URL you can get the page or the group ID using this free simple online tool:
http://whatismyfacebookid.com
You can try https://commentpicker.com/find-facebook-id.php to find a Group ID by entering the FB Group URL. Most of the other online tools don't work anymore.
You can also find it in the source code like mentioned in the other comments. Go to the group page, right click and choose "View Source code" and search for fb://group/. The Group ID will be displayed after the slash or after ?id=
Based upon graph api, you can get group ids as follows:
$facebook->api( '/'.$userId.'/groups', 'GET', array( 'access_token=' => $userToken ));
by iterating through its results.
1) Go to Facebook (www.facebook.com)
2) Click on the little triangle on the top right
3) Select "Manage Groups"
4) Ensure you are on the "Groups" not "Discover" tab (check top left for that)
5) Click on your group
6) Look at your URL from your web browser, it will display something like http://www.facebook.com/groups/12345/about
12345 would be your group in this case.
I hope this helps
Regards
Heider