Facebook: Is it possible to DELETE a Checkin via Graph API? - facebook

When I post a checkin to Facebook the API returns the id of the story created.
How can I delete this story?
I tried to delete using
DELETE -> /me/ID
or
DELETE -> /ID
without success.
I received the response GraphMethodException: Unsupported delete request.

You're right, it doesn't work for me either:
{
"error": {
"message": "Unsupported delete request.",
"type": "GraphMethodException",
"code": 100
}
}
But, as Lix quoted:
NOTE: Publishing a Checkin object is deprecated in favor of creating a Post with a location attached.
From https://developers.facebook.com/docs/reference/api/checkin/
It means that Checkin should not be used anymore. Instead, you have to create a Post.
You can create a post on behalf of the user by issuing an HTTP POST
request to PROFILE_ID/feed (not PROFILE_ID/posts)
Creating a post with a location:
Result:
{
"id": "1022369832_4517701013579"
}
Deleting the post with a location:
DELETE -> http://graph.facebook.com/1022369832_4517701013579
Result: true
I think that you haven't any other choice.

Related

Commenting on posts Facebook graph api V2.10

Is it possible to comment on any post using the id of the post ? I tried with the V2.9 and the comment is successful but when I tried it with V2.10 it shows me the following error
{
"error": {
"message": "(#3) Publishing comments through the API is only available for page access tokens",
"type": "OAuthException",
"code": 3,
"fbtrace_id": "B7DlJt0HMOL"
}
}
This is what I did in the Graph api Explorer
When I switch the version to V2.9 the comment in the post is successful. Why does this happen or how can I fix it?
The error message tells you what the issue is, commenting on everything else than Page posts is deprecated since v2.10 and will not work anymore:
90-Day Breaking Changes
POST and DELETE /{comment-id} — This node now requires a valid page access token.
For more information, take a look at the changelog: https://developers.facebook.com/docs/graph-api/changelog/version2.10

facebook api get page ratings return Unsupported get request

I already followed instructions from this https://developers.facebook.com/docs/graph-api/reference/v2.0/page/ratings
some config I have already made, this has been run only in facebook graph explorer
using page_access_token from me/accounts which is a required just want to post this
the field=open_graph_story and other fields
age restrictions changed back and forth
country restrictions changed back and forth
still having the same problem.
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
Is there something to do with the selected developer only to use this api? I have read something like that in the facebook api but failed to locate the url.
Any details about this problem, please, at least refer me some links.

FB Graph API: Get id of a page with a country restriction

Is it possible to get the Page ID of a page that has country restrictions?
Usually if I do something like http://graph.facebook.com/google
I'll get a response object with a bunch of info (incl. the id).
However doing http://graph.facebook.com/[page_with_country_restriction] returns:
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
Yes. It's possible to get the information of a page with country restrictions. You just need a valid Access Token for that.
Try making a request to the URL using that Access Token. Something like:
https://graph.facebook.com/teabeauty?access_token={Access_Token}
You can always make use of Graph API Explorer to test your requests and queries.

Facebook API issue when deleting some comments

Whenever I try to delete a comment made to a Wall post originating from FB I get the following error:
{
"error": {
"message": "(#1705) Selected wall post for deletion does not exist.",
"type": "OAuthException",
"code": 1705
}
}
Now this doesn't make any sense since the comment has can_remove attribute set to true, and I can delete any comment made to a post by the app, only the comment to a post which was posted in FB isn't deletable. Any ideas?

How do I acquire DELETE permissions on Facebook Graph API (PHP SDK)?

Simple, imagine I am posting a wall post or an event on a random Facebook Page from a PHP script, and I want to delete the item. I simply use this :
$facebook->api('/'.FacebookId,'DELETE');
Of course, the FacebookId is structured like : userid_postid
But that doesn't work. To see why, I simply go to this URL :
https://graph.facebook.com/" + postID + "?method=delete&access_token=" + AccessToken;
Here is the result :
{
"error": {
"message": "(#200) Permissions error",
"type": "OAuthException",
"code": 200
}
}
By lurking around stackoverflow, I found this bug : http://bugs.developers.facebook.net/show_bug.cgi?id=12777
It is still not resolved.
So if anyone knows how to get this permission, I would appreciate your help.
According to the documentation:
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.
Is this the case? Has your app created the post? does it have the "publish_stream" permissions?
I just tried it using the graph explorer, I created a post by POSTing to the me/feed, got back an id (USERID_POSTID) and then issues a DELETE request to the id, and it worked well (the returned response was "true").