最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Facebook Graph API Post with_tags option - Stack Overflow

programmeradmin3浏览0评论

I'm experiencing an issue with /. Namely, option called "with_tags".

options = {
    "message": "Test123", 
    "with_tags": {
        "data":[
            {"id": 100001686722916, "name": "Aret Aret"}
        ]
    }
};
FB.api('/me/feed', 'post', options, function(response) {
    if (!response || response.error) {
        alert('Error occured');
        console.log(response);
    } else {
        console.log(response);
    }
});

As a result, I just get a message "Test123" but no "with" tags in my post. The user I use in "with" section is on my friends list and is a developer of the app as well. Thanks.

I'm experiencing an issue with http://developers.facebook./docs/reference/api/post/. Namely, option called "with_tags".

options = {
    "message": "Test123", 
    "with_tags": {
        "data":[
            {"id": 100001686722916, "name": "Aret Aret"}
        ]
    }
};
FB.api('/me/feed', 'post', options, function(response) {
    if (!response || response.error) {
        alert('Error occured');
        console.log(response);
    } else {
        console.log(response);
    }
});

As a result, I just get a message "Test123" but no "with" tags in my post. The user I use in "with" section is on my friends list and is a developer of the app as well. Thanks.

Share Improve this question edited Apr 8, 2013 at 19:46 Rob 4,94712 gold badges52 silver badges56 bronze badges asked Jul 23, 2012 at 14:29 OutWardOutWard 1212 gold badges2 silver badges5 bronze badges 2
  • response is 100% valid. No error messages. – OutWard Commented Jul 23, 2012 at 14:32
  • I've updated my answer with info based off a new announcement on the facebook developer blog – TommyBs Commented Aug 22, 2012 at 6:34
Add a ment  | 

2 Answers 2

Reset to default 8

I actually think the "with_tags" option is read only when returning the feed object. It's not an option you can POST https://developers.facebook./docs/reference/dialogs/feed/#graphapicall .I think what you want to use is just "tags" and it should just contain id's as specified here https://developers.facebook./docs/reference/api/user/#posts

**note you cannot do this though without also specifying a place

EDIT**** Facebook have now released mention tagging which might be the solution you need https://developers.facebook./docs/opengraph/mention_tagging/

Here's an example on how to publish to user feed while tagging some friends:

FB.api(
    "/me/feed",
    "POST",
    {
        "message": "This is a test message",
        "place": "link",
        "tags": "friend_id1,friend_id2"
    },
    function (response) {
      if (response && !response.error) {
        console.log(response); /* post id will be returned */
      }
    }
);

From: https://developers.facebook./docs/graph-api/reference/v2.5/user/feed

发布评论

评论列表(0)

  1. 暂无评论