1

I want to send a wall post to facebook and tag one of my friend via graph api. I have my friends facebook ID. where should I write his/her Id to be able to tag him/her in my wall post?

params.putString("access_token", facebook.getAccessToken());
params.putString("Message","I m here");

String response = facebook.request("me/feed", params, "POST");

Thanks for your helps

1
  • @ user1448565 I am also looking for the same. did you get solution for this?
    – Manikandan
    Feb 27, 2013 at 10:24

4 Answers 4

3

1) Create a String array of friends id and pass it to .request() method

for(int j=0;j<numArr.length;j++)
{
   Utility.mAsyncRunner.request("Photo_id/tags/"+numArr[j], param, "POST", new SampleUploadListener(), null); 
}
2

in your code, just add:

params.putString("place", "155021662189");

Use "155021662189" if you don't know any FB placeId. In my application, this worked.

Reference: http://codenigeria.com/discussion/245/facebook-api-how-to-make-status-update-on-facebook-but-also-tag-some-facebook-friends-in-it-/p1

1

Comma-separated list of Facebook IDs of people tagged in this Post. For example: 1207059,701732. This field is returned as the with_tags field when the Post is read.

NOTE: You cannot specify this field without also specifying a place.

Where place is :- Facebook Page ID of the location associated with this Post

Check this:-

https://developers.facebook.com/docs/reference/api/user/#posts

1
  • please provide the code for reference..how to tag the friends..what to write in the key value pair of the putString method of the bundle.
    – jyomin
    Nov 12, 2014 at 6:21
0

Have a look at the graph api: http://developers.facebook.com/docs/reference/api/post/

message_tags can be used to tag anything

3
  • params.putString("message_tags",userIdOfFriend); I did this when I am sending my message but it is now shown on my wall. It shows only "I am here"
    – akbas
    Jun 19, 2012 at 15:15
  • The parameter is called tags – see developers.facebook.com/docs/reference/api/user/#posts
    – CBroe
    Jun 19, 2012 at 16:00
  • Getting this error when I use tags. I don't want to do checkin, I want to only tag a friend on a wallpost. {"error":{"message":"(#100) Cannot specify user tags without a place tag","type":"OAuthException","code":100}}
    – akbas
    Jun 19, 2012 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.