{"id":1447,"date":"2022-08-30T15:16:36","date_gmt":"2022-08-30T15:16:36","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/19\/retrieving-messages-from-status-table-in-fql-using-php-sdk-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:16:36","modified_gmt":"2022-08-30T15:16:36","slug":"retrieving-messages-from-status-table-in-fql-using-php-sdk-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/retrieving-messages-from-status-table-in-fql-using-php-sdk-collection-of-common-programming-errors\/","title":{"rendered":"Retrieving messages from status table in FQL using PHP SDK-Collection of common programming errors"},"content":{"rendered":"<p>I am developing a php script for retrieving messages from a page (not user) in facebook. I have access to that page (it is mine) so if I must to modify something in config, I can.<\/p>\n<p>I tried the FQL query in graph api webpage from Facebook and it works. I get the file with all messages.<\/p>\n<p>But whenever I try it in my php script, it fails. I am trying it in a localhost server and calling the script : &#8220;localhost\/testServer\/phpScript.php&#8221; I don&#8217;t know if I have to add a parameter.<\/p>\n<p>I have checked many examples and tutorials and all are similar but in my case, they don&#8217;t work.<\/p>\n<p>I always get an exception with this message:<\/p>\n<pre><code>Fatal error: Uncaught Exception: 100: Requires user session thrown in C:\\xampp\\htdocs\\testServer\\base_facebook.php on line 1271\n<\/code><\/pre>\n<p>If I surround it in try\/catch and print what I get, it tells it is an exception with getType() and an array with getResult().<\/p>\n<p>My code is quite simple:<\/p>\n<pre><code>\n<\/code><\/pre>\n<p>I just deleted my appId, secret and access_token.<\/p>\n<p>I read something about read_stream permissions using status table. But adding access_token and ext_perm tags has no effect. I leave the uid of the webpage because it is public so you can test the code on your own.<\/p>\n<p>If I can&#8217;t do this query with php fql, I have no problem in using normal api if I can get the same result.<\/p>\n<p>I am expending many days doing this script and I am completely lost with the problem.<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-19 13:16:55. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I am developing a php script for retrieving messages from a page (not user) in facebook. I have access to that page (it is mine) so if I must to modify something in config, I can. I tried the FQL query in graph api webpage from Facebook and it works. I get the file with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1447","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1447","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1447"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1447\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1447"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}