Tagging users in user feed post using graph API - facebook-graph-api

On the Graph API page it shows a table showing the arguments we can use to create a new post to a feed
/PROFILE_ID/feed
Publish a new post on the given profile's feed/wall
message, picture, link, name, caption, description, source, place, tags
We want to be able to post to a users wall and tag their friends.
i.e. User 1 is doing something with User 2 and 5 others
What format should the tag attribute take?

For those who are interested:
tags is sent as an array of FB user ids
tags can only be added if there is a place associated with the post also

you have to post a Checkin to add place and tag friends

On Graph API Explorer you can use the below parameters:
/me/feed?message=<text-message-after-encoded>&place=<page-ID-of-location>&tags=<facebook-user-id,facebook-user-id,...>

Related

Facebook Graph API Search Posts for specific text in message field

Is there a way with graph facebook to search specific text content in the message of a user's posts? The assumption here is that the user id and access token is already available as well as all applicable permissions (ie. the user_posts permissions, etc..).
I read through the search feature on graph:
Facebook Graph Docs-Advanced
The following graph explorer example was provided:
GET graph.facebook.com/search?
q={your-query}&
type={object-type}
The table that lists the available types in the link provided is very limited (place, placetopic, ad_*). Is that the full list of possible types? Can we use POSTS or user posts as a type. I couldn't find the right syntax anywhere.
My goal is to retrieve a user's posts based on a specific message tag or text in their post message. Currently, the only way I know how to do this is highly inefficient. I would have to do the following:
Get user's full list of posts
https://graph/facebook/com/{version}/{userID}/?fields=posts&access_token={token}
Run a coded query to get the posts I need and discard the rest
Thanks in advance.

How to retrieve specific user's posts on a page using graph api

I want to retrieve the posts on a page's wall but only of a particular user. I am unable to query the graph api with filter. Please help
There is no such filtering available. If you need this, you will have to do the filtering on your end.
You will either have to go through the page's feed and check the from field of the posts for the user id, or through the user's posts (requires that you get user_posts permission from the user first) checking the to field for the page id.

How to post on a friends wall with GraphAPI?

I'm using GraphAPI for posting to a friend's wall but I'm unable to do it.
I'm trying the below link:
http://graph.facebook.com/friendID/feed
Can anyone help me how to post to your friend's wall?
As of february, you can't post content to a friend's wall using the API - see here: https://developers.facebook.com/roadmap/completed-changes/#february-2013
Removing ability to post to friends walls via Graph API We will remove
the ability to post to a user's friends' walls via the Graph API.
Specifically, posts against [user_id]/feed where [user_id] is
different from the session user, or stream.publish calls where the
target_id user is different from the session user, will fail.
You can post links using the FB.ui function w/ the 'to' parameter set to a friend's id, however.
See the following change from 6th March 2013, posted on the list of completed changes in the Facebook Developers' Roadmap:
Removing ability to post to friends walls via Graph API
We will remove the ability to post to a user's friends' walls via the Graph API. Specifically, posts against [user_id]/feed where [user_id] is different from the session user, or stream.publish calls where the target_id user is different from the session user, will fail.
If you want to allow people to post to their friends' timelines, invoke the feed dialog. Stories that include friends via user mentions tagging or action tagging will show up on the friend’s timeline (assuming the friend approves the tag). For more info, see this blog post.

Facebook Graph api - post to friends timeline issue

when I tried to post to my friends timeline using facebook graph api, I got
{"error":{"message":"(#200) Feed story publishing to other users is disabled for this application","type":"OAuthException","code":200}}
Enabling something while creating access_token will resolve this problem ?
If so what should I enable.
Thanks,
Padmaprasad G
This feature has been removed the 6th February : http://developers.facebook.com/roadmap/completed-changes/
Look here how to do it Facebook App: Will fb.api method post on friend's wall?
Yes, this was announced few months back and took effect on Feb 6th - http://developers.facebook.com/roadmap/completed-changes
Removing ability to post to friends walls via Graph API
We will remove the ability to post to a user's friends' walls via the Graph API. Specifically, posts against [user_id]/feed where [user_id] is different from the session user, or stream.publish calls where the target_id user is different from the session user, will fail. If you want to allow people to post to their friends' timelines, invoke the feed dialog. Stories that include friends via user mentions tagging or action tagging will show up on the friend’s timeline (assuming the friend approves the tag). For more info, see this blog post.
The workaround is to use the Feed Dialog which allows users to post the same content, but choose the user they want to post it to.

post a link in facebook graph api explorer as a page

i am using graph api explorer and an application to post on the wall of a page of my own
when i use the field message and put in it the link it will be posted as a link string only without the pictures in the link as u post it from outside the graph explorer and the poster will be the name of the page via the application
but when i use the "link" field and put the link in it, it will give the form that i want but the poster will be the name of the account and not the name of the page
1st of all: i am trying the post in the graph api explorer before i use my c# console application that will post to the page wall. if i copy the link of a website page and open the page through facebook and paste the link in the status filed it will automatically generate something like a form that contain the picture and some details and if i click post the status will appear as posted by the page itself and it will contain first the link as a text and then the form that i talked about will appear
if i use the c# sdk and post the status as: fbArgs["message"] = txtT.ToString(); facebook.Post("/PAGE_ID/feed", fbArgs); the post will contain the link only without the form that appears automatically when I post the same string in the facebook page website. if i use the "link" field with the link as a value it will be posted by the name of the account but with the form that i want?
how can i post a link that will generate automatically the form that will be created when u paste a link in the status edit box on the facebook website??
You cal refer to this old stackover flow question: Facebook Graph API PHP SDK posting on page as page
You have to manually specify the meta tags for the link using the parameters:
picture Post thumbnail image (can only be used if link is specified)
name Post name (can only be used if link is specified)
caption Post caption (can only be used if link is specified)
description Post description (can only be used if link is specified)
You can create a post on a Page by issuing an HTTP POST request to
PAGE_ID/feed with the publish_stream and manage_pages permissions and
the following parameters. Additionally, Page posts can also be
scheduled to go live at a future time up to 6 months or can be created
in an "unpublished" state where they are not visible on the pages
timeline or in the page fan's news feeds. Unpublished posts can be
used as Sponsored Stories.
Read more at: http://developers.facebook.com/docs/reference/api/page/#links