How to fix “Unsupported post request” when posting

2019-07-04 01:42发布

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?

1条回答
Deceive 欺骗
2楼-- · 2019-07-04 02:12

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.

查看更多
登录 后发表回答