The initial problem is that you were using /home
and not /feed
.
/home
- The user's news feed.
/feed
- The user's wall.
https://developers.facebook.com/docs/reference/api/user/
You can split it the same way you did with the previous (/home
) object
//Get latest post
int id_post = 0;
string stringPostId = obj["data"][id_post]["id"].ToString(); //Id of the post
string stringPostSender = obj["data"][id_post]["from"]["name"].ToString(); //Name of sender
string stringPostSenderId = obj["data"][id_post]["from"]["id"].ToString(); //ID of sender
Each object looks like this so you should be able to figure out how to drill down
{
"id": "5_11111111",
"to": {
"data": [
{
"name": "User A",
"id": "4"
}
]
},
"from": {
"name": "User B",
"id": "5"
},
"message": "This is a test message",
"created_time": "2013-10-04T23:01:42+0000"
}
Your last update is a common mistake many first time developers make.
An application access token should not be used for these calls. You must have a login flow to grant a user access token via OAuth by starting with
https://www.facebook.com/dialog/oauth?
client_id={app-id}
&redirect_uri={redirect-uri}
Please read in detail https://developers.facebook.com/docs/facebook-login/login-flow-for-web-no-jssdk/ for an explanation of the process.