PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, February 27, 2022

[FIXED] Facebook API Search - Search for Groups?

 February 27, 2022     facebook, facebook-graph-api, facebook-group, facebook-php-sdk, php     No comments   

Issue

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);

Solution

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.



Answered By - Tobi
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing