I'm playing with facebook explorer to get event photos urls.
For {event-id}/photos I get something like:
{
"data": [
{
"created_time": "2015-12-07T20:53:44+0000",
"name": "1913 rok.",
"id": "178797088851556"
}
],
"paging": {
"cursors": {
"before": "OTc4Nzk3MDg4ODUxNTU2",
"after": "OTc4Nzk3MDg4ODUxNTU2"
}
}
}
How can I exctract this photo (id: 178797088851556) url?
It´s called "Declarative Fields":
/{event-id}/photos?fields=name,source
Check out the API reference for all available fields.
Related
Calling the Facebook campaign insights API, I want to retrieve "action_values".
I've tried from PHP code and from tool explorer using an url like this:
XXXXXX/insights?fields=action_values
but this is the result (action_Values not appear in response)
{
"data": [
{
"date_start": "2021-02-25",
"date_stop": "2021-02-26"
}
],
"paging": {
"cursors": {
"before": "MAZDZD",
"after": "MAZDZD"
}
}
}
I currently don't have any campaigns that have been launched with ACTIVE status in Facebook so whenever I try to query the insights endpoint I receive an empty array of data[] which doesn't allow me to do much.
I would like to know how a response would look for an adset that has been launched with an active status and actually contains insights' data, using a query like this one:
GET graph.facebook.com/v8.0/{adset_id}/insights?date_preset=lifetime&fields=reach,unique_ctr,cpm&access_token={access_token}
I think is that it might look something like this, but I would like to get the exact response structure:
{
"data": [
{
"name": "metric_name",
"values": [
{
"end_time": "some_date_string",
"value": numeric_string,
}
]
}
]
}
I've made <adset_id>/insights?date_preset=lifetime&fields=reach,unique_ctr,cpm
Example output:
{
"data": [
{
"reach": "12739",
"unique_ctr": "1.420834",
"cpm": "13.740269",
"date_start": "2020-02-25",
"date_stop": "2021-01-28"
}
],
"paging": {
"cursors": {
"before": "MAZDZD",
"after": "MAZDZD"
}
}
}
How is it possible that I can add another access token to this call that references the second id I would like to retrieve reviews from.
In all other instances like posts, photos etc this would work but because you are required to have a page access token to retrieve the data for reviews I'm not sure how to construct the url to make the call. Is it possible?
https://graph.facebook.com/ratings?ids=slickremix,reformavi&field=rating&limit=5&access_token=EAAP9hArvboQBAN5...
That call returns something like this, as you can see the second id reformavi is not returning data.
{
"slickremix": {
"data": [
{
"created_time": "2016-10-13T09:22:02+0000",
"reviewer": {
"name": "Jens Kranen",
"id": "10211267740634296"
},
"rating": 5,
"review_text": "Fantastic customer support. Very quick response. Spencer could identify the problem within minutes and gave great advice.\nThank you"
},
{
"created_time": "2016-10-07T14:22:19+0000",
"reviewer": {
"name": "Marc McHale",
"id": "10157614348555341"
}
"rating": 5,
"review_text": "I purchased the Facebook Reviews plugin for a client website and both my client and I are very happy with the appearance and functionality! Plus, the customer service was outstanding!"
}
],
"paging": {
"cursors": {
"before": "MTM4MjkwMTM4ODoxMTg3OTA3NTE1MjU4ODQZD",
"after": "MTI1MTQ3Njk2NToxMTg3OTA3NTE1MjU4ODQZD"
},
"next": "https://graph.facebook.com/v2.7/118790751525884/ratings?access_token=EAAP9hArvboQBAN5HpnbA5m87qC7poAAqB0YS47zxBCBmCfVRcqCC7zX1XDNCv6cSe3KFnMtPVysUms0MuXLxWfv8D9McMwzvD2HWWd0IO6FOZC6ogvcta8FWZBR0vUA9HCZAdqdB53fyUB26XLb76ORLspiPg3Hzb4Pn5RTjwZDZD&pretty=1&limit=5&after=MTI1MTQ3Njk2NToxMTg3OTA3NTE1MjU4ODQZD"
}
},
"reformavi": {
"data": [
]
}
}
From Graph API Explorer of Facebook I'm trying to publish a story on my wall, without success.
The post was to URL: /2.4/me/my_app_name_space:my_action
with a parameter as: my_object_type : id_of_my_object
The request seems was ok because the response:
{
"data": [
{
"created_time": "2015-08-06T16:09:02+0000",
"title": "My title",
"type": "<my_name_space>:<my_object_type>",
"id": "XXXXXXXXXXXXXX",
"count": 8,
"first_action_id": "XXXXXXXXXX",
"first_time": "2015-09-10T09:42:07+0000",
"last_action_id": "XXXXXXX",
"last_time": "2015-09-11T19:24:38+0000"
}
],
"paging": {
"cursors": {
"before": "YYYYYYYYYYYYYY",
"after": "YYYYYYYYYYYYYY"
}
}
}
Well, I went immediately to my wall but nothing was published.
So I make a GET request to path: /2.4/me/my_app_name_space:my_action/my_object_type and the response contains the previous object.
Does it means the POST query was ok? But then, why the story is not published?
Maybe you're looking for the explicitly shared parameter.
fb:explicitly_shared=true
Further info here:
https://developers.facebook.com/docs/sharing/opengraph/using-actions#explicit
I have post_id of the status which user share by iOS app, Now with graph api, I'm getting comment info and like info:
POST_ID?fields=likes.fields(pic_square,name),comments
With above, I'm able to fetch most of the details, but not profile pic of user who commented on post. check details which I'm getting:-
{
"id": "POST_ID",
"updated_time": "2014-03-25T07:07:14+0000",
"likes": {
"data": [
{
"pic_square": "https://fbcdn-profile-a.akamaihd.net/static- ak/rsrc.php/v2/yo/r/UlIqmHJn-SK.gif",
"name": "User name",
"id": "100007640XXXXX"
}
],
"paging": {
"cursors": {
"after": "MTAwMDA3NjQwMzcxMzQxxx",
"before": "MTAwMDA3NjQwMzcxMzQxxx"
}
}
},
"comments": {
"data": [
{
"id": "2069772628xxxxxx",
"from": {
"name": "user name",
"id": "100007640xxxxxx"
},
"message": "great reader..",
"can_remove": true,
"created_time": "2014-03-26T06:19:36+0000",
"like_count": 0,
"user_likes": false
}
],
"paging": {
"cursors": {
"after": "MQ==",
"before": "MQ=="
}
}
}
}
Now I need picture of a user who commented on post, I'm getting picture of user who likes, but not who commented. I tried to get it with FQL but not succeed.
Here in response you are getting user id who had liked your post so use that as follows
https://graph.facebook.com/10000445993xxxxx/picture?type=large
Use this API:
https://graph.facebook.com/100007640xxxxxx/picture
100007640xxxxxx: is userid.
Edit:
if you want to load user picture in particular size then you can use following:
https://graph.facebook.com/100007640xxxxxx/picture?width=150&height=150