I posted something on a page wall in Facebook (using Graph-API). Checking the data via Graph-Explorer results with posts from me. An example:
{
"id": "640047619xxxxx_6405845194xxxxx",
"from": {
"id": "640047619xxxxx6"
},
"message": "[time]test_total_neu",
"privacy": {
"value": "EVERYONE",
"description": "Public",
"friends": "",
"allow": "",
"deny": ""
},
"type": "status",
"status_type": "mobile_status_update",
"application": {
"name": "Graph API Explorer",
"id": "145634995xxxxx"
},
"created_time": "2015-04-10T10:45:22+0000",
"updated_time": "2015-04-10T10:45:22+0000",
"is_hidden": false,
"subscribed": true
},
Facebook won't show these entries on the wall. I googled almost the entire morning, but can't find a solution for that. Any ideas?
Thanks so far!
Related
I am using Graph Explorer and trying to fetch each individual wall post my friends sent to me on a specific day (my birthday).
My request is for the feed:
https://graph.facebook.com/100000015733365/feed?access_token=xyz&since=7+October+2015
response:
{
"data": [
{
"id": "<post_id_2>",
"from": {
"name": "<name2>",
"id": "<id2>"
},
"story": "<name2> and 69 others wrote on your timeline.",
"story_tags": {
"0": [
{
"id": "<id2>",
"name": "<name2>",
"type": "user",
"offset": 0,
"length": 8
}
],
"37": [
{
"id": "<my_id>",
"name": "<my_name>",
"type": "user",
"offset": 37,
"length": 8
}
],
"13": [
{
"id": "<id3>",
"name": "<name3>",
"type": "user",
"offset": 13,
"length": 9
},
{
"id": "<id4>",
"name": "<name4>",
"type": "user",
"offset": 13,
"length": 9
},
{
"id": "<id5>",
"name": "<name5>",
"type": "user",
"offset": 13,
"length": 9
}
]
},
"privacy": {
"value": "",
"description": "",
"friends": "",
"allow": "",
"deny": ""
},
"type": "status",
"status_type": "wall_post",
"created_time": "2015-10-07T20:43:07+0000",
"updated_time": "2015-10-07T20:43:07+0000",
"is_hidden": false,
"is_expired": false
}
It seems Facebook groups the posts by content, it's okay on my wall (in web browser) but how can I turn off this behavior through the API call?
I cannot find any setting related to this even after I read the API reference thoroughly.
I need these grouped posts one by one because I would like to process them in python, since I cannot achieve this with the graph explorer I think it's okay to not post python code right now.
An alternative would be to expand this 'story' into a list of individual posts but this is well hidden according to the documentation.
Any help is appreciated, thanks!
I have a page in facebook as well as an app for it.
I have generated a never expire token for the page , and tried to post to the page using the graph api POST /me/feed
However, the messages i posted only appears if i query /me/feed in the graph api but not on the page wall. Why is this happening?
result for /me/feed
{
"id": "**********",
"from": {
"category": "Education",
"name": "**************",
"id": "**************"
},
"message": "ok",
"actions": [
{
"name": "Comment",
"link": "https://www.facebook.com/**********"
},
{
"name": "Like",
"link": "https://www.facebook.com/************"
}
],
"privacy": {
"description": "Public",
"value": "EVERYONE",
"friends": "",
"networks": "",
"allow": "",
"deny": ""
},
"type": "status",
"status_type": "mobile_status_update",
"application": {
"name": **********",
"id": "************"
},
"created_time": "2015-02-01T05:26:29+0000",
"updated_time": "2015-02-01T05:26:29+0000"
},
{
"id": "825588500832993_846332195425290",
"from": {
"category": "Education",
"name": "************",
"id": "825588500832993"
},
"message": "asd",
"actions": [
{
"name": "Comment",
"link": "https://www.facebook.com/*************"
},
{
"name": "Like",
"link": "https://www.facebook.com/**************"
}
],
"privacy": {
"description": "Public",
"value": "EVERYONE",
"friends": "",
"networks": "",
"allow": "",
"deny": ""
},
"type": "status",
"status_type": "mobile_status_update",
"application": {
"name": "**********",
"id": "**************"
},
"created_time": "2015-02-01T05:22:02+0000",
"updated_time": "2015-02-01T05:22:02+0000"
},
For anyone facing the same problem, go to developers.facebook.com-> your app -> settings-> fill up email , then go to status & review -> switch the off button to on to make it live
I am trying to create a Facebook wall using the objects from the users feed. However, what I cannot seem to do is get the picture of the friends who have posted on my wall.
I am currently using an if statement to check the feed object for the from property below. I can get the id from the from property, but that only allows me to get it if I do another api call within the loop to construct the wall. However, since it is async i cannot return the values, and I also can't concatenate it with the src attribute. Any suggestions on how to get around this problem?
{
"data": [
{
"id": "64582869534783990_343788612678878",
"from": {
"id": "32458397413435340",
"name": "User Name"
},
"message": "this is my message",
"actions": [
{
"name": "Comment",
"link": "https://www.facebook.com/144375679690/posts/245786252634978"
},
{
"name": "Like",
"link": "https://www.facebook.com/245786252634978/posts/245786252634978"
}
],
"privacy": {
"description": "Your friends",
"value": "ALL_FRIENDS",
"friends": "",
"networks": "",
"allow": "",
"deny": ""
},
"type": "status",
"status_type": "mobile_status_update",
"application": {
"name": "App Name",
"id": "245786252634978"
},
"created_time": "2014-11-08T22:26:06+0000",
"updated_time": "2014-11-08T22:26:06+0000"
}
]
}
Just use field expansion
me/feed?fields=from{id,name,picture}
{
"id": "11882030_4952296803730",
"from": {
"name": "xxx",
"id": "11882030"
},
"message": "test",
"picture": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-ash4/408410_4952294483672_298434229_s.jpg",
"link": "https://www.facebook.com/photo.php?fbid=4952294483672&set=pcb.4952296803730&type=1&relevant_count=2",
"icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yx/r/og8V99JVf8G.gif",
"actions": [
{
"name": "Comment",
"link": "https://www.facebook.com/11882030/posts/4952296803730"
},
{
"name": "Like",
"link": "https://www.facebook.com/11882030/posts/4952296803730"
}
],
"privacy": {
"description": "Friends",
"value": "ALL_FRIENDS",
"friends": "",
"networks": "",
"allow": "",
"deny": ""
},
"place": {
"id": "471607792876974",
"name": "TTT",
"location": {
"street": "",
"zip": "",
"latitude": x,
"longitude": x
}
},
"type": "photo",
"status_type": "mobile_status_update",
"object_id": "4952294483672",
"application": {
"name": "Facebook for iPhone",
"namespace": "fbiphone",
"id": "6628568379"
},
"created_time": "2013-01-17T01:29:59+0000",
"updated_time": "2013-01-17T01:29:59+0000",
"comments": {
"count": 0
}
}
As above, I posted a status with two photos. I can get the first photo's thumb URL in picture and the relevant link & count information in link.
But how can I get each photo's specific URL?
FQL often provides more information than Graph API. You have to use the attachment parameter of the stream FQL table to get all the attached photos.
SELECT attachment FROM stream
WHERE source_id = me()
AND post_id="11882030_4952296803730"
Result:
{
"data": [
{
"attachment": {
"media": [
{
"href": "https://www.facebook.com/photo.php?fbid=471082296...",
"alt": "",
"type": "photo",
"src": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-ash3/5826...",
"photo": {
"aid": "4391039135",
"pid": "439104482145",
"fbid": 471507,
"owner": 102832,
"index": 1,
"width": 485,
"height": 172,
"images": [
{
"src": "https://fbcdn-photos-a.akamaihd.net/hph...",
"width": 130,
"height": 46
}
]
}
}
],
"name": "",
"caption": "",
"description": "",
"properties": [
],
"icon": "https://fbstatic-a.akamaihd.net/rsrc.phpjk.gif",
"fb_object_type": "album",
"fb_object_id": "4391044992857139135"
},
{
... //Photo 2
}
}
]
}
Based on Stéphane Bruckerts answer; you're after attachments. So I'd recommend simply requesting the attachments field in your graph request.
Although this question is a few years old, it still comes up when searching for this topic.
Facebook (Meta) Graph API has changed. Current Facebook (Meta) Graph API is version 13.0.
The best endpoint I found was to use the "/feed" URI slug, with "fields=attachments". Simply cURL / GET:
https://graph.facebook.com/v13.0/$PAGEID/feed?access_token=$AUTHTOKEN&fields=attachments,full_picture,id,message,story
Reference: https://developers.facebook.com/docs/graph-api/reference/v13.0/page/feed
I want to get stats (likes, comments, shares) of a Facebook post. How can I do it?
Url: https://graph.facebook.com/<userid>_<postid> - there is a plenty of information about the wall post.
http://developers.facebook.com/tools/explorer - you can use this tool for testing.
Sample data:
{
"id": "<userid>_<postid>",
"from": {
"name": "User Name",
"id": "<userid>"
},
"message": "playing with graph api",
"actions": [
{
"name": "Comment",
"link": "http://www.facebook.com/<userid>/posts/<postid>"
},
{
"name": "Like",
"link": "http://www.facebook.com/<userid>/posts/<postid>"
}
],
"privacy": {
"description": "Public",
"value": "EVERYONE"
},
"type": "status",
"created_time": "2012-03-14T11:33:14+0000",
"updated_time": "2012-03-14T11:33:14+0000",
"comments": {
"count": 0
},
"is_published": true
}
You should just use https://graph.facebook.com/<postid> if it is a status.
You can get the postid by clicking on the date/time in your feed.
If the type is a comment then you can use
https://graph.facebook.com/<postid>_<commentid>