Facebook Graph API帖子带有标记选项
Facebook Graph API Post with_tags option
我遇到一个问题http://developers.facebook.com/docs/reference/api/post/.即,名为"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);
}
});
结果,我只收到了一条消息"Test123",但在我的帖子中没有"with"标签。我在"with"部分使用的用户在我的朋友列表中,也是该应用程序的开发者。谢谢
我实际上认为"with_tags"选项在返回提要对象时是只读的。这不是您可以POST的选项https://developers.facebook.com/docs/reference/dialogs/feed/#graphapicall。我认为你想要使用的只是"标签",它应该只包含这里指定的idhttps://developers.facebook.com/docs/reference/api/user/#posts
**注意,如果不指定一个位置,你就不能这样做
编辑****Facebook现在发布了提及标签,这可能是你需要的解决方案https://developers.facebook.com/docs/opengraph/mention_tagging/
下面是一个关于如何在标记一些朋友的同时发布到用户提要的示例:
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 */
}
}
);
发件人:https://developers.facebook.com/docs/graph-api/reference/v2.5/user/feed
相关文章:
- 我的单元测试选项是什么
- 如何更改bigquery API中的计费层选项
- 使用Javascript获取所选选项ID
- Selectize.js:如何对整数值的选项进行排序
- 通过js在新选项卡中有条件地打开url
- 按照选项卡索引的顺序循环一个jQuery选择
- 如何在使用selectBoxIt JQuery插件时检测选项更改
- 无法在Ionic select中预先选择最后一个选项
- 如何在选项卡上定义属性'的主窗口对象
- 为什么grunt contrib connect的中间件选项的第三个参数是未定义的
- 使用此选项选择父类内部的类
- CKeditor:更改对话框中的默认选择选项
- JQuery覆盖不更改单选选项
- 活动选项卡's源代码-获取变量s值
- 绑定时将Parsley minlength消息作为选项传递时,未对其进行自定义
- 如何从选择框中的选项中获取属性值
- 如何在从多选下拉列表中选择选项值时动态生成文本框
- React Native通过Navigator将用户输入数据传递到选项卡栏IOS中的组件
- 如何从外部页面激活非默认引导选项卡
- Facebook Graph API帖子带有标记选项