Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook PHP throwing exception "(#803) Some of the aliases you requested do not exist"

I have a valid and authenticated user, but when posting to their wall from our PHP web app it returns:

Fatal error: Uncaught OAuthException: (#803) Some of the aliases you requested do not exist: xxxxxxxxxxxxx","name":"xxxxxxx

I have 24 other users that can post with no issues. And I can see the user exists by going to https://graph.facebook.com/xxxxxxxxxxxxx

Here is the code:

    $fb_user_id = $row[0]; // loaded from DB
    $facebook_token = $row[1]; // loaded from DB

    $result = $facebook->api('/' . $fb_user_id. '/feed/',
                                'post',
                                array('access_token' => $facebook_token,
                                    'message' => $postMessage,
                                    'name' => 'Product name',
                                    'caption' => 'Accomplished!',
                                    'link' => 'http://www.xxxxxxx.com/',
                                    'description' => $postMessage,
                                    'picture' => 'http://www.xxxxxxx.com/images/productImage.png'));

Any ideas why the Facebook API thinks this user does not exist?

like image 813
Chris Masterton Avatar asked May 05 '11 05:05

Chris Masterton


2 Answers

I had this issue, later I realised I was saving the uid in my database as an integer, however, new facebook profiles have very long uids, such as : 100004409446248, this was not a value I could save as an integer in my mysql database, I changed this to treat it as a varchar, so now there's no issue

like image 61
Daniel Avatar answered Oct 15 '22 18:10

Daniel


This question Getting list of Facebook friends with latest API suggests

$friends = $facebook->api('/me/friends');

like image 21
0xAli Avatar answered Oct 15 '22 17:10

0xAli