How to fix "Unsupported post request" when posting to FB fan page?

10,626

Solution 1

The error suggests that your app is still in testing / sandbox mode. Make your application public and then you should be able to make the API call.

Solution 2

use this instead of your code:

    $ret_obj = $this->fb_obj->api("/{$page_id}/feed", 'POST',
        array(
            'link' => $link,
            'message' => $message,
        ));


    if($ret_obj){
        return $ret_obj['id'];
    }
Share:
10,626
Paolo
Author by

Paolo

Updated on June 04, 2022

Comments

  • Paolo
    Paolo almost 2 years

    I have a script which can do the ff:

    • post a link to a user's timeline/wall
    • post a link to a user's page as an admin

    The posting to a user's profile page works fine. However, the posting to a fan page is acting weird, I am able to post but I get back the "Unsupported post request" error.

    I've searched SO about this problem and tried every solution offered but still I get this error. I tried both the PHP 4.0.0 SDK and PHP 3.2.3 SDK, same error.

    Here is an excerpt of my code using SDK 3.2.3:

            $ret_obj = $this->fb_obj->api("/{$page_id}/feed", 'POST',
                array(
                    'link' => $link,
                    'message' => $message,
                ));
    
    
            if($ret_obj){
                return $ret_obj['id'];
            }
    
            return false;
    

    While here is my code using SDK 4.0.0:

            $response = (new FacebookRequest(
                $session, 'POST', $edge, array(
                    'link' => $link,
                    'message' => $message,
                )
            ))->execute()->getGraphObject();
    
    
            if($response){
                return($response->getProperty('id'));
            }
    
            return false;
    

    As for scope of permissions, I use the ff => 'email','user_about_me','offline_access','publish_stream','publish_actions','manage_pages','user_photos','user_groups'.

    Has anyone encountered this problem?

  • سید فیصل
    سید فیصل about 3 years
    I need my account
  • سید فیصل
    سید فیصل about 3 years
    I don't know but your best