Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook API Search - Search for Groups?

I have been testing the Facebook php sdk. I am able to search for pages & places but not groups. According to the documentation, this should return groups...

https://graph.facebook.com/search?q=programming&type=group

The below code works. If I change the type from "page" to "group", the code fails. I do not get an exception:

$query = urlencode('Harlem');

$type = 'page';


$results = $facebook->api('/search?q='.$query.'&type='.$type);
like image 874
A. R. Jones Avatar asked Mar 15 '14 01:03

A. R. Jones


1 Answers

It depends on what kind of Access Token you're using. As of https://developers.facebook.com/docs/reference/api/search/#access_tokens searches for pages require an App Access Token, whereas searches for Groups require an User Access Token. Please check accordingly.

like image 53
Tobi Avatar answered Oct 02 '22 17:10

Tobi