facebook - 无法通过 Facebook Instant Article API 的 DELETE 方法删除文章

标签 facebook facebook-graph-api facebook-instant-articles

我有一个已创建文章的 ID,我还可以通过 GET 方法获取文章的状态:

{article_id}?access_token={access_token}

我收到如下回复:

{
  "id": {article_id},
  "status": "SUCCESS"
}

但是当我尝试使用具有相同参数的 DELETE 方法删除文章时,我得到了这样的响应:

{
  "error": {
    "message": "(#240) Requires a valid user to be specified (either via the session or via the API parameter for specifying the user.",
    "type": "OAuthException",
    "code": 240,
    "fbtrace_id": "GsXXXXBjq"
  }
}

一切都是按照 documentation 完成的.

我正在使用具有此权限的 v2.6 图形版本:

publish_pages, pages_manage_instant_articles, manage_pages

我使用了一个不会过期的页面 token ,我通过 @Simon.Ponder's answer 获得了它.

应用程序和页面只有一个管理员用户。

如何解决?

最佳答案

我可以使用 facebook-instant-articles-sdk-php 删除帖子

     $client = Client::create(
                     $this->options->app_id,
                     $this->options->app_secret,
                     $this->options->access_token,
                     $this->options->page_id,
                     true);

     try {
             $client->removeArticle($my_canonical_url)
     } catch (Exception $e) {
             throw $e->getMessage();
     }

希望对大家有帮助。

关于facebook - 无法通过 Facebook Instant Article API 的 DELETE 方法删除文章,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37936724/

相关文章:

facebook - 尽管 Facebook API v2.x,Tinder 如何获得共同好友

javascript - 如何避免重新解析 XFBML 元素?

facebook - 一般错误 : 'Article Updated From Different Page' while creating instant article in facebook

javascript - Facebook Instant Article 自定义嵌入不发出请求

facebook - Facebook即时文章音频播放器

html - CSS:DIV 中的文本被截断

facebook-graph-api - Facebook Graph API - 获取 facebook 群组帖子

facebook - 使用 FB.api() 时应该传递访问 token 吗?

facebook - Symfony HWIOAuthBundle 从 facebook 获取用户事件和喜欢

Facebook 点赞按钮 : how it choose image to display