Facebook 图形 API 和php sdk,删除事件!

发布于 2024-10-17 17:50:12 字数 2940 浏览 2 评论 0原文

在我的一生中,我找不到删除、取消或删除我创建和删除的 Facebook 活动的方法。使用 FB PHP SDK 进行更新图形 API。

我已经尝试了 facebook 文档和文档中找到的每一个排列。堆栈溢出...

以下是我在任务中发现的一些线索..

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

Facebook SDK 和 Graph API 评论删除错误< /a>

Facebook API - 删除状态

Facebook Graph API - 删除 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
    }       
}   

For the life of me, I cannot find a way to delete, cancel or remove facebook events I created & updated using the FB PHP SDK & the Graph API.

I've tried every single permutation found on facebook's documentation & stack overflow...

Here are some of the clues I have found on my quest..

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

Here is what I have tried so far.

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
    }       
}   

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

巷子口的你 2024-10-24 17:50:12

嘿彼得,
我尝试运行你的代码,但很遗憾我也没有取得太大成功。

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

虽然我尝试过,但我不断收到 #200 权限错误

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

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

有趣的是 - 尽管此错误已被标记为已解决 - 如果您阅读评论,用户仍然会报告相同的问题。

很抱歉无法提供太多帮助。
祝你好运

Hey Peter,
I tried running your code and I'm sorry to say I didn't have much success either.

My first guess was that you probably did not have the extended permissions - for deleting an event, you need to have to create_event permission

Although I tried with that, I keep getting the #200 Permission Error

On further digging I ran into a similar bug that was reported

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

Interestingly - although this bug has been marked as resolved - if you read the comments, users are still reporting the same issue.

Sorry wasn't able to offer much help.
Good luck

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文