5

I have a problem using the PHP SDK:

$fql="{'query1':'SELECT uid2 FROM friend WHERE uid1=me()',
         'query2':'SELECT author_uid FROM checkin WHERE author_uid IN(SELECT uid2 FROM #query1) AND page_id = $page_id'}";

     $friends= $facebook->api(array(
       'method' => 'fql.multiquery',
       'queries' => $fql,
      'access_token' => $access_token
     ));

And I use plenty page ids.

When I ran this script in https://graph.facebook.com/fql/?access_token=AC&q=QUERIES It works perfect.

But when I use the php-sdk, sometime it works but for some pages it returns me the error:

FacebookApiException Object
(
    [result:protected] => Array
        (
            [error_code] => 1
            [error_msg] => An unknown error occurred
        )

    [message:protected] => An unknown error occurred
    [string:Exception:private] => 
    [code:protected] => 1
    [file:protected] => /APP_PATH/base_facebook.php
    [line:protected] => 1249
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] => /APP_PATH/base_facebook.php
                    [line] => 816
                    [function] => throwAPIException
                    [class] => BaseFacebook
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                    [error_code] => 1
                                    [error_msg] => An unknown error occurred
                                )

                        )

                )

Anyone can help me please? I can't figure why I get this error.....

Mołot
  • 699
  • 12
  • 36

2 Answers2

6

Sometimes when you make a big calls through the api facebook will return:

An unknown error occurred

AS an example if you make a call to get comments on post with 4000 comments with (limit = 1000) facebook will return the data but if you try (limit = 4000) facebook will return the same error

AboQutiesh
  • 1,696
  • 2
  • 9
  • 14
  • I'm running into a similar issue and decreasing the limit fixes it. Do you know of any way to pull all the data without getting this error? – zap2008 Jun 07 '13 at 14:10
  • 3
    hey @zap2008 You can use facebook Pagination see Here https://developers.facebook.com/docs/reference/api/pagination/ – AboQutiesh Jun 10 '13 at 07:48
3

sometime it works but for some pages it returns me the error

Have you checked your permission? You may not be allowed to request that information.

sakibmoon
  • 2,026
  • 3
  • 22
  • 32