Try to use Graph API Explorer and get my page reviews, use this URL
111280982309/ratings?fields=reviewer{id,name,picture.width(120).height(120)},created_time,rating,recommendation_type,review_text,open_graph_story{id}
but can't get rating and reviewer fields
Here are the results :
{
"data": [
{
"created_time": "2017-12-08T12:27:33+0000",
"recommendation_type": "positive",
"review_text": "Très professionnels, s'adaptent à toutes les situations",
"open_graph_story": {
"id": "1655894074569809"
}
},
...
{
"created_time": "2013-11-24T06:14:30+0000",
"recommendation_type": "positive",
"open_graph_story": {
"id": "1020383498134514"
}
}
]
}
with all the permission needed :
pages_show_list
pages_read_engagement
pages_read_user_content
public_profile
After multiple hours of research, I do not find any solutions...
My app is business type (and there is no more live or dev mode button)
The app is approuved for all the permission above
Related
I am the admin of my companies Facebook page. I'm trying to get all the ads for the Facebook page using the Graph API. The access token that I use has the following permissions:
read_insights
manage_pages
ads_read
ads_managment
...
How can I get the comments below the ads posts?
This is what I tried using Graph API:
my_page_ID/ads_posts
What I get is this:
{
"data": [
{
"created_time": "2020-03-26T14:42:38+0000",
"message": "We have the best price. Please come to us!",
"id": "4353425346_5634563463622263"
},
{
"created_time": "2020-03-26T12:28:35+0000",
"message": "This is some add",
"id": "65464567_687456456"
},
{
"created_time": "2020-03-26T12:19:34+0000",
"message": "This is the message of the ad.",
"id": "123456789_463456534623"
},
{
"created_time": "2020-03-20T08:06:44+0000",
"id": "34534588605_358563733107"
},
{
"created_time": "2020-03-20T08:06:44+0000",
"id": "388533217888605_3586754538066441"
},
{
"created_time": "2020-03-20T08:06:44+0000",
"id": "34353417888605_5844534530"
},
{
"created_time": "2020-03-20T08:06:44+0000",
"id": "38854535405_230852376563421"
},
{
"created_time": "2020-03-20T08:06:18+0000",
"id": "382342345605_358677843899"
What I do not understand:
Why are most fields empty? Am I doint sth. wrong? Do I need more permissions?
How can I retriev all ads posts and not just a few?
How can I retriev the user comments below these posts?
Hope you can help me with this.
Easy peasy!
/{page-id}/ads_posts?include_inline_create=true
Includes all Ads Posts (Dark Posts)
We are building an app that manage Facebook comments for page admins. When managing the comments, we want to know if there is any "admin_notes" or "custom_labels" that the page admin has previously applied on that specific owner of the comment.
I imagine the API is something like this:
https://graph.facebook.com/v3.3/45013343238491111/comments?order=reverse_chronological&fields=message,from{name,id,custom_labels,admin_notes,likes}&access_token=...
The api above should theoretically return list of comments made on a post, with their owners name, id, and custom_labels etc.
But the comment listing response is like this:
{
"data": [
{
"message": "sdfsdfsdf",
"from": {
"name": "Dora Chan",
"id": "23424292416969420",
"likes": {
"data": [
{
"name": "Page name",
"id": "XXXXXX",
"created_time": "2019-05-29T06:03:42+0000"
}
],
"paging": {
"cursors": {
"before": "Mzg5OTgwNzQ4MjcxNzU3",
"after": "Mzg5OTgwNzQ4MjcxNzU3"
}
}
}
},
"id": "450133432384921_450162525715345"
},
{....
Information like "page likes" is available. But information like admin_notes and custom_labels are not available.
Why is that so?
Note:
I am using page access Token. All page related permissions are granted:
manage_pages, pages_show_list, publish_pages, pages_messaging, public_profile
If I call graph API on that specific user directly, i.e. https://graph.facebook.com/v3.3/[userid]?fields=name,id,likes,custom_labels&access_token=...
The outcome is same, I can see only name, userid, likes, but I cannot see custom_labels
I can use my app_token to call the Graph API Explorer to get the basic information of the Fan Page email, website etc...
Just using /v2.6/20531316728?fields=emails,website,name
But how can I get the Fan Page Additional Contact Info (e.g. Twitter, Instagram, WeChat, LINE, YouTube, etc...) using app_token?
Further research after my comment turns up the following...
While not intuitive through the docs, this is available via the Facebook Graph API for Pages. The field you are looking for is screennames.
https://graph.facebook.com/nasa?fields=screennames&access_token=TOKEN
Example Response
{
"screennames": {
"data": [
{
"service_name": "Twitter",
"value": "nasa"
},
{
"service_name": "Instagram",
"value": "nasa"
},
{
"service_name": "Snapchat",
"value": "nasa"
},
{
"service_name": "YouTube",
"value": "nasa"
}
]
},
"id": "54971236771"
}
Note that it returns the free text that people type in the input type on the Facebook Page edit screen. Sometimes you'll see just the social media name, other times you might see a full or partial url.
Hi can someone please tell me (Im using Facebook Connect Plugin for Phonegap) how I can get the users friends scores?
according to multiple sources all you should need to do is an API call to:
facebookConnectPlugin.api( '/me/scores', ['user_friends'], function( response ) {
});
as the current permissions for this app are (from access token debug):
public_profile, basic_info, read_stream, email, publish_actions, user_friends, user_games_activity
but the response I get is always the same:
{
"data": [
],
"summary": {
"total_count": 39
}
}
and if I use /{appid}/scores I get:
{
"data": [
{
"user": {
"id": "147555555555",
"name": "Snowden Luke"
},
"score": 1005,
"application": {
"name": "DFdfdf",
"namespace": "dfdfdfd",
"id": "5205555555583"
}
}
]
}
(its me!)
any help?
According to https://developers.facebook.com/docs/graph-api/reference/v2.1/app/scores#readperms
/{app-id}/scores
returns
Scores from this Facebook game for a user and their friends.
so, this seems to be the right endpoint for you. Concerning permissions, the docs say that
A user access token is required to view scores by that user from the app that generated the token. If the user_friends permission has been granted, it will also returns friends' scores.
Questions:
Are you sure your friends used the same app, and have posted scores?
Are you using a correct Access Token (generated by the same app from whcih the scores came from)?
Is it even possible to retrieve comments on Facebook ads through the API (Graph or FQL)? If yes, do I need a whitelisted app to do it? Also, if I have a page access token, is it enough, or I need a user access token with ads_management permission?
Regarding the token usage, a page_token is extended by a given user to a given app. The page_token will have at most the same privileges as the user on his authorized pages and ad_accounts.
Generating a page_token can be done automatically, in behalf of the user, if you already have a user_token with manage_pages permission. Again, this page_token will have at most the same privileges that the user_token you used to generate it.
In other words, having a page_token doesn't amount for any additional privileges than the ones already present in the user_token.
Having said that, you need
a token with access to a given ad_account
that the app for which that token was generated, has that ad_account active in its settings
If the second requisite isn't met, for example for ad_account act_123456789 you'll get the error:
{
"error": {
"message": "(#274) The ad account is not enabled for usage in Ads API. Please add it in developers.facebook.com/apps -> select your app -> settings -> advanced -> advertising accounts -> Ads API. Account 123456789 not enabled for this application.",
"type": "OAuthException",
"code": 274,
"fbtrace_id": "xxxxx"
}
}
You can try, for example, generating a token with all privileges for the Graph API Explorer App. It will throw the error above because said App doesn't have the ad_account act_123456789 enabled.
So, given you have a token with ads_read extended for an app that has this ad_account listed, and you know the ad_id, you can procede as I explained in thread Get comments from facebook ads (marketing)
Basically, you use the ad_id (for example 123000000) to get the promoted post id and its actions
/123000000?fields=creative.fields(effective_object_story_id),insights.fields(actions)
The answer will contain an effective_object_story_id (for example, let's say it is 456000000_789000000) and its actions broken down by type:
{
"creative": {
"effective_object_story_id": "456000000_789000000",
"id": "123000000"
},
"insights": {
"data": [
{
"actions": [
{
"action_type": "comment",
"value": "12"
},
{
"action_type": "like",
"value": "2"
},
{
"action_type": "post",
"value": "3"
},
{
"action_type": "post_reaction",
"value": "29"
},
{
"action_type": "video_view",
"value": "558"
},
{
"action_type": "page_engagement",
"value": "604"
},
{
"action_type": "post_engagement",
"value": "602"
}
],
"date_start": "2017-08-14",
"date_stop": "2017-08-20"
}
],
"paging": {
"cursors": {
"before": "xxx",
"after": "xxx"
}
}
}
}
If you want to also distinguish paid comments from regular comments, you can query the comments edge of the post_id 456000000_789000000 to get the overall comment count which should be greater than the comments generated by the ad.
You can't pull the actual words of the comment via the API - would make it too easy to scrape.
Yes, Facebook ads that have comments are because the ad is a promoted page post, whether that page post is hidden or not. Page post comments are available via the Facebook API and does not require having Ads API access. Use the graph API endpoint /v2.1/{page-id}/comments to retreive page post comments. See the Facebook Graph API documentation on object comments for more information.