Search from Facebook API

孤者浪人 提交于 2020-01-04 02:34:10

问题


I implemented the post search from Facebook api V2.0 on a test server which is still working fine. But when shifted the code to client server and registered a new app for that url. It gives the result

stdClass Object
(
    [error] => stdClass Object
        (
            [message] => (#11) Post search has been deprecated
            [type] => OAuthException
            [code] => 11
        )
)

On previous app of test it is still working. If the post search is deprecated then it should not work on both. I'm not getting if i'm missing some settings in app or what.


回答1:


I encountered the same problem, before this post.

For apps created before April 30th 2014, making API calls without specifying a version number is equivalent to calling v1.0 of the API.

For apps created on or after April 30th 2014, making API calls without specifying a version number is equivalent to calling v2.0 of the API. These apps won't be able to call v1.0 of the API.

https://developers.facebook.com/docs/apps/upgrading

In fact, I tried with a a new app created today. I solved this problem by taking the ID and the key of an app created before the 30/04/2014

For the v2: Public post search is no longer available. (/search?type=post&q=foobar)




回答2:


Yes it works with the old API version, you can try it without having an old AppId, you can use the Graph API Explorer access_token , it works for me with calling this URL :

https://graph.facebook.com/search?type=post&q=Gaza&access_token={Graph API Explorer access_token}
  • you can get the access_token directly from here: https://developers.facebook.com/tools/explorer

hope this helps.



来源:https://stackoverflow.com/questions/23511485/search-from-facebook-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!