如何使用 Facebook 上的 ID 和权限(访问令牌)删除帖子?

发布于 2024-12-01 14:47:41 字数 495 浏览 8 评论 0原文

我创建了一个 Facebook 应用程序,该应用程序有权在墙上发帖,具有离线访问权限,并且可以在数据库中存储访问令牌。

该应用程序只需要您访问画布页面一次,然后它将开始每 5 小时为您提供一个“帖子”。

因此,作为升级,我需要删除之前的帖子(我有它的 ID)并发布新帖子,这样我们就不会收到垃圾邮件报告。

那么我如何使用访问令牌和帖子 ID 删除帖子,就像 Shady Wallas post_id{"id":"1658870381_2143043309837"}

以下是一些示例数据:

 https://graph.facebook.com/    Graph url   
 Shady.wallas                   Profile and User ID  
 1658870381_2143043309837       Post ID  
 "planbxe3qxdfghk......."       Access token  

I have created a Facebook application that has the permission to post on wall, has offline access, and can store access tokens in the database.

The application only needs you to go to canvas page once, and then it will start serving you a "post" every 5 hours.

So as an upgrade, I need to delete the previous post (I have it's id) and post a new one so we don't get spam reports.

So how can i delete the Post using an access token and Post ID, like that on Shady Wallas post_id{"id":"1658870381_2143043309837"}

Here is some example data:

 https://graph.facebook.com/    Graph url   
 Shady.wallas                   Profile and User ID  
 1658870381_2143043309837       Post ID  
 "planbxe3qxdfghk......."       Access token  

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

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

发布评论

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

评论(2

尴尬癌患者 2024-12-08 14:47:41

Facebook 图形 API 文档 告诉您:

您可以通过向以下对象发出 HTTP DELETE 请求来删除图中的对象:
对象 URL,即

DELETE https://graph.facebook.com/ID?access_token=... HTTP/1.1

The Facebook graph API documentation tells you:

You can delete objects in the graph by issuing HTTP DELETE requests to
the object URLs, i.e,

DELETE https://graph.facebook.com/ID?access_token=... HTTP/1.1
清眉祭 2024-12-08 14:47:41

正如 OffBySome 所说,这在 Graph API 文档中明确涵盖,帖子的示例位于 https://developers.facebook.com/docs/reference/api/post/#delete

You can delete a post as long as your application created the post. 
You delete a post by issuing an HTTP DELETE request to the POST_ID object
with publish_stream permission.

请注意,未经用户明确同意向用户墙发布内容违反 Facebook 政策,并且可能会导致垃圾邮件报告并启动反垃圾邮件系统,无论您随后是否要删除这些帖子并用其他较新的帖子替换它们。如果有的话,当用户发现归因于您的应用程序的内容出现和消失时,可能会导致更多报告。

As OffBySome stated, this is expressly covered in the Graph API Documentation, the example given for posts is at https://developers.facebook.com/docs/reference/api/post/#delete

You can delete a post as long as your application created the post. 
You delete a post by issuing an HTTP DELETE request to the POST_ID object
with publish_stream permission.

Note that publishing to a user's wall without their explicit consent is against Facebook policy, and will likely result in spam reports and trip anti spam systems regardless of whether you're subsequently removing the posts and replacing them with other, newer posts. If anything, it might result in more reports as users find content appearing and disappearing which is attributed to your application.

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