使用Graph API将链接发布到Facebook群组

时间:2015-11-19 05:42:23

标签: facebook facebook-graph-api

我们如何使用PHP / Javascript中的Graph API将链接发布到Facebook群组中。我已经按照以下文档。

https://developers.facebook.com/docs/graph-api/reference/v2.5/group/feed

语法:

FB.api(
    "/{group-id}/feed",
    "POST",
    {
        "message": "This is a test message"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
   }

);

我的代码:

FB.api(
    "/https://www.facebook.com/groups/990024677728712/feed",
    "POST",
    {
    "message": "The India national football team is governed by the All India Football Federation (AIFF). Since 1948, the AIFF has been affiliated with FIFA, the international governing body for football. In 1954, the AIFF became one of the founding members of the Asian Football Confederation (AFC). The team was automatically advanced to play in the 1950 FIFA World Cup (all the other Asian teams withdrew), but they did not go to the tournament in Brazil due to the cost of travels and certain financial crisis.[5] They won gold medals at two Asian Games and one silver at the Asian Cup.",
    "link": "https://www.the-aiff.com/"
    },
    function(response){
      if (response && !response.error) {
        /* handle the result */
      }
   }
);

它没有发布到Facebook。请帮我。提前谢谢。

1 个答案:

答案 0 :(得分:0)

呼叫需要到

FB.api(
    "/990024677728712/feed",
    "POST",
    ...
);

中的文档所述

如果您想要发布到群组的Feed中,它还会在文档中明确表示您需要user_managed_groupspublish_actions权限。