首页 文章

facebook graph api&php sdk,删除活动!

提问于
浏览
3

对于我的生活,我找不到删除,取消或删除我使用FB PHP SDK和Graph API创建和更新的facebook事件的方法 .

我已经尝试了在facebook的文档和堆栈溢出中发现的每一个排列...

以下是我在追求中发现的一些线索 .

https://developers.facebook.com/docs/reference/api/#deleting https://developers.facebook.com/docs/reference/api/event/ https://developers.facebook.com/docs/reference/rest/events.cancel/

Facebook SDK and Graph API Comment Deleting Error

Facebook API - delete status

Facebook Graph API - delete like

这是我到目前为止所尝试的 .

function delete_fb_event($event_data, $data)
{
    //load the user for offline access and userid
    $user = $this->load_user($data['aid']);

    if(!empty($user[0]['fb_offline_access']))
    {
        //instantiate Facebook API
        require 'facebook.php';
        $facebook = new Facebook(array(
          'appId'  => 'BLAHBLAHBLAH',
          'secret' => 'BLAHBLAHBLAHBLAHBLAHBLAH',
          'cookie' => true,
        ));

        $fb_event = array(
            "access_token" => $user[0]['fb_offline_access'],
        );

        $result = $facebook->api('/'.$event_data['fb_event_id'], 'DELETE', $fb_event); //Uncaught GraphMethodException: Unsupported delete request
        //$result = $facebook->api('/'.$user[0]['fb_id']."_".$event_data['fb_event_id'], 'POST', array('access_token' => $user[0]['fb_offline_access'], 'method' => 'delete')); Uncaught OAuthException: (#803) Some of the aliases you requested do not exist
        //$result = $facebook->api('/'.$event_data['fb_event_id']."_".$user[0]['fb_id'], 'POST', array('access_token' => $user[0]['fb_offline_access'], 'method' => 'delete')); Uncaught OAuthException: (#803) Some of the aliases you requested do not exist  
        //$result = $facebook->api('/'.$event_data['fb_event_id'], 'POST', array('access_token' => $user[0]['fb_offline_access'], 'method' => 'delete')); Uncaught GraphMethodException: Unsupported post request
        //$result = $facebook->api('/'.$user[0]['fb_id']."_".$event_data['fb_event_id'], 'POST', array( 'access_token' => $user[0]['fb_offline_access'], 'method' => 'delete' )); Uncaught OAuthException: (#803) Some of the aliases you requested do not exist
        return $result;         
    }
    else
    {
        echo "error3"; //no FB offline access
    }       
}

1 回答

  • 3

    嘿彼得,我试着运行你的代码,我很遗憾地说我也没有太大的成功 .

    我的第一个猜测是你可能没有扩展权限 - 要删除一个事件,你需要具有create_event权限

    虽然我试过这个,但我一直得到#200权限错误

    在进一步挖掘时,我遇到了一个类似的错误报告

    http://bugs.developers.facebook.net/show_bug.cgi?id=12777

    有趣的是 - 虽然这个错误被标记为已解决 - 如果您阅读了评论,用户仍然会报告相同的问题 .

    抱歉,无法提供太多帮助 . 祝好运

相关问题