如何使用 Facebook Graph API 分享某人的帖子 [英] How to share someone's post using Facebook Graph API

查看:23
本文介绍了如何使用 Facebook Graph API 分享某人的帖子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Facebook 应用在用户墙上发布消息.我想在我的墙上分享这些消息,就像我在用户消息下单击共享操作一样.我如何使用 Facebook Graph API 做到这一点?

解决方案

是的,您可以使用 graph2 api 进行共享.你这样做的方法是使用 /feed edge 并传递你想要作为链接分享的帖子的 url.

POST/v2.2/{page-id}/feed HTTP/1.1主持人:graph.facebook.com链接=https://www.facebook.com/{page_id}/posts/{post_id}

对您分享的帖子的标准 Facebook 权限确实适用.

My Facebook App posts messages on user wall. I want to share this messages on my wall, same as I click share action under user message. How can I do it using Facebook Graph API?

解决方案

Yes, you can share using the graph2 api. The way you do it is to use /feed edge and pass the post's url that you want to share as the link.

POST /v2.2/{page-id}/feed HTTP/1.1
Host: graph.facebook.com

link=https://www.facebook.com/{page_id}/posts/{post_id}

Standard Fb permissions to the post you are sharing do apply.

https://developers.facebook.com/docs/graph-api/reference/v2.2/page/feed

This was done today, in a local rails app, using FbGraph2 gem, with the above method.

这篇关于如何使用 Facebook Graph API 分享某人的帖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆