删除相册 Facebook Graph API?
大家好,有谁知道删除相册的正确图形路径吗?我尝试了很多东西,但似乎没有任何效果?
/me/aid
/aid
/me/object_id/albums
/me/object_id
/me/albums/object_id
/object_id/album"
/object_id/albums
/object_id
显然用有效值替换 aid
和 object_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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
嗯,据我所知,无论权限如何,您都不允许通过图形 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.
来自 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,您可以这样做:
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:
我认为您可以通过 /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...
要通过 AS3 Facebook API 删除对象,请使用
Facebook
对象的deleteObject(method,callback)
函数。To delete objects via the AS3 Facebook API, use the
deleteObject(method,callback)
function of theFacebook
object.