删除相册 Facebook Graph API?

发布于 2024-10-14 23:00:12 字数 285 浏览 3 评论 0原文

大家好,有谁知道删除相册的正确图形路径吗?我尝试了很多东西,但似乎没有任何效果?

/me/aid
/aid
/me/object_id/albums
/me/object_id
/me/albums/object_id
/object_id/album"
/object_id/albums
/object_id

显然用有效值替换 aidobject_id...

是否可以通过 Graph API 删除相册?谢谢!

Hi All does anyone know the correct Graph path for deleting an album? I have tried a bunch of things and nothing seems to work?

/me/aid
/aid
/me/object_id/albums
/me/object_id
/me/albums/object_id
/object_id/album"
/object_id/albums
/object_id

obviously replacing aid and object_id with a valid value...

Is it possible to delete an album through the Graph API? thanks!

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

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

发布评论

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

评论(4

说好的呢 2024-10-21 23:00:12

嗯,据我所知,无论权限如何,您都不允许通过图形 API 删除相册。

这已经有一段时间了。

最近(我写这篇文章时是 2012 年 1 月 16 日),图形 API 用户甚至无法删除照片。

这是 Facebook 错误链接:
https://developers.facebook.com/bugs/125524667559003?browse=search_4f14be86ba58f3666689319

是的,FB 构建的应用程序似乎具有链接到您无权访问的应用程序 ID 的特殊权限。例如,我刚刚注意到,当您输入照片的标题时,iOS 应用程序会将照片上传到临时相册,因此最终的“上传”等待时间被认为只有几秒钟(它只是将图片移动到手机上传相册并设置隐私)。我无法通过我看到的任何 API 访问临时相册之类的内容。

您能做的就是提交错误报告。

我很高兴这个答案被否决,因为它不正确,但我花了相当多的时间,不仅查看文档,还观察 iOs 应用程序通过代理服务器正在做什么,并尝试重新创建它。

Umm, as far as I can tell, you simply are not allowed to delete an album through the graph API, regardless of permissions.

This has been true for a while.

Recently (its 1/16/12 when I write this), graph API users can't even delete photos.

Here's the Facebook Bug Link:
https://developers.facebook.com/bugs/125524667559003?browse=search_4f14be86ba58f3666689319

Yes, the FB-built apps appear to have special permissions linked to their App IDs to which you do not have access. I just noticed, for instance, that the iOS app uploads photos to a temporary album while you are typing in the caption for the photo so the final "upload" wait is perceived to be just a few seconds (it just moves the picture to the mobile uploads album and set the privacy). Access to anything like a temp album is not available through any API I can see.

Filing a bug report is about all you can do.

I would be happy to have this answer down voted as not correct, but I have spent a reasonable amount of time not just looking at the docs, but watching what the iOs app is doing through a proxy server and trying to recreate it.

旧城空念 2024-10-21 23:00:12

来自 Facebook 的文档:


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

DELETE https://graph.facebook.com/ID?access_token=... HTTP/1.1
要支持不支持所有 HTTP 方法的客户端(例如 JavaScript 客户端),您也可以使用附加参数 method=delete 向对象 URL 发出 POST 请求以覆盖 HTTP 方法。例如,您可以通过向 https://graph.facebook.com 发出 POST 请求来删除评论/COMMENT_ID?method=删除

您可以通过向 /POST_ID/likes 发出 DELETE 请求来删除点赞(因为点赞没有 ID)。


所以你的最后一个路径是正确的“/object_id”。您需要确保将 HTTP 请求作为“DELETE”或“POST”发送,并设置查询参数 method=delete。例如:

删除 https://graph.facebook.com/ID?access_token=
或者
POST https://graph.facebook.com/ID?method=delete&access_token=< /a>

如果这些都不起作用,请确保您拥有正确的扩展权限。我相信您删除相册所需的权限是“publish_stream”。我以前从未这样做过,所以我可能会错。

如果您使用 Facebook C# SDK,您可以这样做:

var client = new FacebookClient('access_token');
dynamic result = client.Delete('object_id');

From Facebook's documentation:


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
To support clients that do not support all HTTP methods (like JavaScript clients), you can alternatively issue a POST request to an object URL with the additional argument method=delete to override the HTTP method. For example, you can delete a comment by issuing a POST request to https://graph.facebook.com/COMMENT_ID?method=delete.

You can delete a like by issuing a DELETE request to /POST_ID/likes (since likes don't have an ID).


So the last one of your paths is the correct one '/object_id'. You need to make sure you are either sending your HTTP request as a "DELETE" or as a "POST" with the query parameter method=delete set. For example:

DELETE https://graph.facebook.com/ID?access_token=
or
POST https://graph.facebook.com/ID?method=delete&access_token=

If neither of those work, make sure you have the correct extended permission. I believe the permission you need to delete an album is 'publish_stream'. I have never done it before so I could be wrong on that one.

If you are using the Facebook C# SDK you would do it like this:

var client = new FacebookClient('access_token');
dynamic result = client.Delete('object_id');
蓝眸 2024-10-21 23:00:12

我认为您可以通过 /me/albums/ 读取某个相册的 ID,然后在 https:// /graph.facebook.com/ID

在我的尝试中,效果很好......

I think you could read the ID of a certain album by /me/albums/ and after that run the delete on https://graph.facebook.com/ID

On my try it worked just fine...

提赋 2024-10-21 23:00:12

要通过 AS3 Facebook API 删除对象,请使用 Facebook 对象的 deleteObject(method,callback) 函数。

To delete objects via the AS3 Facebook API, use the deleteObject(method,callback) function of the Facebook object.

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