开发者

Delete ALBUM Facebook Graph API?

开发者 https://www.devze.com 2023-02-07 02:29 出处:网络
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?

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!


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.


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');


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消