Unsupported get request. Object with ID '{USER_ID}' does not exist, cannot be loaded due to missing permissions, or does not support this operation - facebook

I am getting this from Facebook webhook. I am trying to get the sender's name and profile picture.
<pre>
{
"object": "page",
"entry": [
{
"id": "172916740162087",
"time": 1609667491,
"changes": [
{
"value": {
"from": {
"id": "2529118547136023",
"name": "Md Abid Hasan Nayem"
},
"post": {
"status_type": "added_photos",
"is_published": true,
"updated_time": "2021-01-03T09:51:29+0000",
"permalink_url": "https://www.facebook.com/CodeWareLTD/posts/851154192338335",
"promotion_status": "inactive",
"id": "172916740162087_851154192338335"
},
"message": "Happy new year",
"post_id": "172916740162087_851154192338335",
"comment_id": "851154192338335_853191445467943",
"created_time": 1609667489,
"item": "comment",
"parent_id": "172916740162087_851154192338335",
"verb": "add"
},
"field": "feed"
}
]
}
]
}
</pre>
When I am sending request with the user id /{USER_ID}?access_token=token then it's returning this error.
Whereas I have all the required permissions approved.
<pre>
{
"error": {
"message": "(#3) Application does not have the capability to make this API call.",
"type": "OAuthException",
"code": 3,
"fbtrace_id": "ABtpgYvcMuaA_jQcW8Fdi3M"
}
}
</pre>
I opened a bug report, but they told me it's ok as per the current Facebook system design. But
still, I'm unable to get the user's first name, last name, and profile picture.
Bug Report Link: https://developers.facebook.com/support/bugs/887826828623849/.
Please, help me to get the exact API to get the sender's name & profile picture.
my currently successfully reviewed permissions are:
email,
pages_manage_metadata,
pages_read_engagement,
pages_show_list,
pages_messaging,
pages_read_user_content,
public_profile,
pages_manage_engagement,
pages_manage_posts

Related

Get Facebook page rating comments

I would like to retrieved comments from a page rating.
I'm getting page ratings from endpoind GET https://graph.facebook.com/v15.0/21[...]58/ratings?fields=created_time,has_rating,has_review,open_graph_story,rating,recommendation_type,review_text,reviewer
I get an array of rating object, with this rating for example:
{
"created_time": "2021-11-06T04:20:20+0000",
"has_rating": false,
"has_review": true,
"open_graph_story": {
"id": "21[...]58",
"message": "Lorem ipsum",
"start_time": "2021-12-26T21:14:02+0000",
"type": "sellers.rates",
"data": {
"recommendation_type": "positive",
"review_text": "Lorem ipsum",
"is_hidden": false,
"language": "fr",
"seller": {
"id": "54[...]12",
"title": "LOREM",
"type": "place",
"url": "https://facebook.com/lorem"
},
"has_review_update": false
}
},
"recommendation_type": "positive",
"review_text": "Lorem ipsum",
"reviewer": {
"name": "John Doe",
"id": "56[...]60"
}
}
Then, I'm trying to get comments from this review by requesting GET https://graph.facebook.com/v15.0/54[...]12_21[...]58/comments
But I get this error:
{
"error": {
"message": "Unsupported get request. Object with ID ' 54[...]12_21[...]58' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "Av[...]fN"
}
}
In the other hand, this request working fine with a "classic" post.
Does that means ratings are not concidered as a post ?
How can I get comments from rating ?
https://developers.facebook.com/docs/graph-api/reference/recommendation/
The Graph API docs do not mention any comments endpoint/edges for a single recommendation, so I assume it is not possible to get them.
Compare the docs to the page post docs: https://developers.facebook.com/docs/graph-api/reference/page-post/#edges

Facebook Webhooks Mentions Event json does not include sender fb user id and user name

This is the sample response json which that Facebook sends to the server once some user mentions page in his post (This json is mentioned as the sample json by facebook):
{
"field": "mention",
"value": {
"post_id": "44444444_444444444",
"sender_name": "Example Name",
"item": "post",
"sender_id": "44444444",
"verb": "add"
}
}
However the json which I am receiving does not contain sender name and sender id :
{
"entry": [
{
"id": {page_id},
"time":{timestamp},
"changes": [
{
"field": "mention",
"value": {
"item": "post",
"verb": "add",
"message": "{message}",
"post_id": "44444444_444444444",
"created_time": {timestamp}
}
}
]
}
],
"object": "page"
}
Can anyone tell me , why Facebook is not sending sender name and sender id .
I am using FB API version :3.2
Permissions are manage_pages, publish_pages

How To User Fetch Friends Data Using Graph API

What i Need:
i need to fetch my friends like email ,id , name .
i have tried using https://developers.facebook.com/tools/explorer/1456/?method=GET&path=me&version=v2.1.
url is like graph.facebook.com/v2.1/me .
data
{
"id": "77",
"email": "af55#gmail.com",
"first_name": "Mo",
"gender": "male",
"interested_in": [
"female"
],
"last_name": "f",
"link": "https://www.facebook.com/app_scoped_user_id/777/",
"locale": "en_GB",
"name": "singh",
"timezone": 5.5,
"updated_time": "2014-08-18T05:34:55+0000",
"verified": true
}
but making call graph.facebook.com/v2.1/user
Error
{
"error": {
"message": "(#803) Cannot query users by their username (user)",
"type": "OAuthException",
"code": 803
}
}
i have refer the url https://developers.facebook.com/docs/graph-api/reference/v2.1/user.
i have tried to solve by go ->getACEESS TOKEN->check on permissions->email->user_friends.
but still i cannot fetch url through user.
making call with me/friends
{
"data": [
{
"name": "Ashwani Gaur",
"id": "62036"
},
{
"name": "Shobhit Puri",
"id": "131"
},
{
"name": "Rahul Raman",
"id": "10007"
},
{
"name": "Piyush Agarwal",
"id": "800899"
},
{
"name": "Neeraj Yadav",
"id": "10000"
}
],
"paging": {
"next": "https://graph.facebook.com/v2.1/777009872366669/friends?limit=5000&offset=5000&__after_id=enc_AeytV0frT0k1mTj0ZfZRTxPsdSP3TVT_Qd-I1Aoc8vA8YseN4Rr8Vg5n6RgECxsd6RXaVNL8fJ0iaI79qEW7K8nw"
},
"summary": {
"total_count": 383
}
}
i need id, name, email, friend personal_info.
Since April 2014 (v2.0), there are no friend permissions anymore and it´s not possible to get user data from people who don´t use the App. See the changelog for more information: https://developers.facebook.com/docs/apps/changelog
The docs are a bit misleading, you can only use /me to get data of the user who is logged in at the moment.
Update:
By requesting /me/friends, you get all the friends using the App. But as i said in my first sentence, there are no friend permissions anymore. You will only get ID and name of your friends, nothing else. Even if your friend authorized your App, you can ONLY get more data with his own session and by calling /me. The email permission only gives you access to the email of the user who is logged in, not access to the emails of all his friends, of course.
You can only store the email after authorizing a user, that is the only way for other users to get the email of his friends - at least the ones who authorized your App too.

Facebook Graph API posts not appearing for users of page, only admin

I created a page on facebook, and am using the graph api to make posts on the timeline. These post show up just fine for me as the admin, but for users the page is empty.
I verified with the graph api explorer. As an admin a GET of /NewsCrier/feed is filled with data.
As a non admin user the same request returns
{
"data": [ ]
}
Here is an example post from the response of my admin user, notice the privacy is set to public:
{
"id": "383422711781035_404880726301900",
"from": {
"category": "Community",
"name": "News Crier",
"id": "383422711781035"
},
"message": "This appears to be the DC shooter, Aaron Alexis",
"picture": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQD4wR0Y9UVbb4Js&w=154&h=154&url=http%3A%2F%2Fwww.justmugshots.com%2Fimg%2F814064%2Flg%2Faaron-alexis.jpg",
"link": "http://www.justmugshots.com/texas/fort-worth/814064",
"name": "Aaron Alexis, Arrested on 2010-09-04",
"caption": "www.justmugshots.com",
"description": "Aaron Alexis was arrested in Fort Worth, Texas on 2010-09-04. See the mugshot now.",
"icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yD/r/aS8ecmYRys0.gif",
"actions": [
{
"name": "Comment",
"link": "https://www.facebook.com/383422711781035/posts/404880726301900"
},
{
"name": "Like",
"link": "https://www.facebook.com/383422711781035/posts/404880726301900"
}
],
"privacy": {
"description": "Public",
"value": "EVERYONE",
"friends": "",
"networks": "",
"allow": "",
"deny": ""
},
"type": "link",
"status_type": "shared_story",
"application": {
"name": "Reddit News Alerts",
"id": "693375074022011"
},
"created_time": "2013-09-16T19:36:07+0000",
"updated_time": "2013-09-16T19:36:07+0000"
}
The problem is that your Facebook app is in sandbox mode, as soon as you take the app from sandbox all the users will se the newly created posts ;)

How do you retrieve the "Place" field of a Facebook Graph Post object?

I am trying to retrieve the "Place" field of a Facebook Graph Post object from a Facebook friend. After obtaining an access token with the friends_status and read_stream permissions, I request from the Graph API like so:
http://graph.facebook.com/[user_id]_[post_id]
What is returned are some of the fields described in the Graph API docs for Post:
{
"id": "1164358582_2458311174854",
"from": {
"name": "Joe Blo",
"id": "1164358582"
},
"message": "Is pretty bummed today",
"actions": [
{
"name": "Comment",
"link": "http://www.facebook.com/1164358582/posts/2458311174854"
},
{
"name": "Like",
"link": "http://www.facebook.com/1164358582/posts/2458311174854"
}
],
"type": "status",
"application": {
"name": "Facebook for Android",
"id": "350685531721"
},
"created_time": "2011-11-20T03:23:04+0000",
"updated_time": "2011-11-20T12:12:49+0000",
"comments": {
"data": [
{
"id": "1164358582_2458311174852_2962531",
"from": {
"name": "Sue Candy",
"id": "1056617421"
},
"message": "OMG I'm so sorry!!!",
"created_time": "2011-11-20T03:25:06+0000"
}
],
"count": 1
}
}
This is all fine and dandy, except for the fact that when I see this Post within my Facebook stream, it also shows a location accompanying the post:
9 hours ago near El Reno, OK
I expected the El Reno, OK Place object returned as a field within this Post, but I don't see it.
In the Facebook Graph API Explorer, I've tried enabling almost every permission and I am not seeing any difference in the response (no "Place" field returned). Am I going about this incorrectly?
Not 100% sure but I think you can only get the "place" info if it is of type "checkin". I totally get where you are coming from, I wondered about that myself.
https://developers.facebook.com/tools/
Try the Graph API Explorer Tool if you haven't already looked at it.