BTW. The api you are using, if succeeds, will delete the entire album and not just one picture. If you want to delete a single picture (mediaItem) use the corresponding API (given in the sample).
Regards, Sachin On Thu, Nov 19, 2009 at 1:57 PM, Sachin Shenoy <[email protected]>wrote: > Hi, > > You can only delete photos from album created by the app. Apps do not have > write/modify access to albums created by user (outside the scope of the > app). > > Below are snippets of code taken from a sample app. > > function createAlbum(title) { var req = opensocial.newDataRequest(); var > spec = opensocial.newIdSpec({"userId" : "OWNER", "groupId" : "@self"}); var > album = new opensocial.Album({"title" : title}); > req.add(req.newCreateAlbumRequest(spec, album), "album"); > req.send(responseCreate); }; > > function deleteAlbum(albumId) { var req = opensocial.newDataRequest(); var > spec = opensocial.newIdSpec({"userId" : "OWNER", "groupId" : "@self"}); > req.add(req.newDeleteAlbumRequest(spec, albumId), "album"); > req.send(function(data) { response(data, "Album " + albumId + " deleted."); > }); }; function updateAlbum(albumId, title) { var req = > opensocial.newDataRequest(); var spec = opensocial.newIdSpec({"userId" : > "OWNER", "groupId" : "@self"}); var album = {"title" : title}; > req.add(req.newUpdateAlbumRequest(spec, albumId, album), "album"); > req.send(function(data) { response(data, "Album " + albumId + " updated."); > }); }; function deleteMediaItem(albumId, mediaItemId) { var req = > opensocial.newDataRequest(); var spec = opensocial.newIdSpec({"userId" : > "OWNER", "groupId" : "@self"}); req.add(req.newDeleteMediaItemRequest(spec, > albumId, mediaItemId), "media"); req.send(function(data) { response(data, > "MediaItem " + albumId + ":" + mediaItemId + " deleted."); }); }; function > updateMediaItem(albumId, mediaItemId, title) { var req = > opensocial.newDataRequest(); var spec = opensocial.newIdSpec({"userId" : > "OWNER", "groupId" : "@self"}); var media = {"title" : title}; > req.add(req.newUpdateMediaItemRequest(spec, albumId, mediaItemId, media), > "media"); req.send(function(data) { response(data, "MediaItem " + albumId + > ":" + mediaItemId + " updated."); }); }; > > Thanks, > Sachin > > > On Wed, Nov 18, 2009 at 9:01 PM, Zsolt Antal <[email protected]> wrote: > >> Hi all! >> >> We are developing an application to the Orkut. >> We would like to delete one picture from the registered user's >> pictures. We use this method: >> >> opensocial.DataRequest.newDeleteAlbumRequest from >> >> http://wiki.opensocial.org/index.php?title=Opensocial.DataRequest_%28v0.9%29 >> >> >> function request() { >> var req = opensocial.newDataRequest(); >> var albumId = "5404586056101969706"; >> var idspec = opensocial.newIdSpec({ "userId" : "VIEWER", "groupId" >> : >> "SELF" }); >> req.add(req.newDeleteAlbumRequest(idSpec, albumId)); >> >> >> This method belongs to the 0.9 version. But it isn't working. >> Do you think that, We use the function badly or the Orkut does not >> support this method yet? >> >> Anyway does opensocial.newDeleteMediaItemRequest(idSpec, albumId, >> mediaItemId) exist? We haven't >> found it at wiki.opensocial.org, but it was mentioned in myspace >> forum. >> >> Thanks a lot! >> >> -- >> >> You received this message because you are subscribed to the Google Groups >> "Orkut Developer Forum" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<opensocial-orkut%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/opensocial-orkut?hl=. >> >> >> > -- You received this message because you are subscribed to the Google Groups "Orkut Developer Forum" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/opensocial-orkut?hl=.

