如何邀请用户好友参加活动? Facebook 图形 API
我有一个使用 Graph API 的应用程序。我让它为用户创建活动,但想让用户从我们的网站邀请他们的朋友,而不必访问活动 Facebook 页面。有谁知道我也必须发送朋友的 ID 才能像旧 API 一样邀请他们吗?或者它是否存在?我发现 API 文档中的很多细节都很模糊。谢谢你!
另外,附带问题,您可以在创建帖子时发送活动照片吗?我没有看到有关如何提交活动创建照片的说明。谢谢。
I have an application using the Graph API. I have it creating events for the user, but would like to let the user invite their friends from our site instead of having to go to the events Facebook page. Does anyone know of the request I have to send the friends' IDs too to invite them like with the old API? Or if it even exists? I am finding a lot of the finer details in the API documentation are vague. Thank you!
Also, side question, can you send an event photo with the create POST? I see no mention on how to submit a photo with the event creation. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
事实上,我从 Facebook 团队得到了答案,他们只是告诉我通过新的 PHP 接口使用旧的 API。他们尚未转换此功能,也不知道是否会转换。
编辑:
这是我从新 api ($id_array) 获取 ID 后用来邀请朋友的代码。这应用于 PHP Facebook 对象的包装器中,我用来保存所有 Facebook 特定代码。
I actually was able to get an answer from the Facebook team and they just told me to use the old API through the new PHP interface. They have yet to convert this functionality and don't know if it will be converted.
Edit:
Here is the code I used to invite friends after I got the IDs from the new api ($id_array). This is applied in a wrapper around the PHP Facebook object I used to hold all my Facebook specific code.
这实际上可以通过 Graph API 实现,特别是
事件
对象的invited
连接:邀请用户参加事件。如果请求成功,则返回
true
。邀请多个用户参加活动。如果请求成功,则返回
true
。您需要
create_event
权限。更多信息请参阅这篇文章。This is actually possible with the Graph API, specifically the
invited
connection of theevent
's object:Invite a user to an event. Returns
true
if the request is successful.Invite multiple users to an event. Returns
true
if the request is successful.You'll need the
create_event
permission. More info is available in this post.邀请用户参加活动的可能性已在 v2.4 中删除图API:
无法再邀请用户参加活动,您必须使用 facebook.com。
The possibility to invite users to an Event was removed in v2.4 of the Graph API:
There is no way to invite users to an Event anymore, you have to use facebook.com instead.
请参阅邀请选定用户参加 Facebook 活动(通过 Graph API)
Facebook 现在有一个用于邀请朋友参加活动的图表 API。
http://developers.facebook.com/docs/reference/api/event/< /a>
Invited
创建
您可以通过向 /EVENT_ID/invited/USER_ID 发出 HTTP POST 来邀请用户参加活动。您可以通过向 /EVENT_ID/invited?users=USER_ID1,USER_ID2,USER_ID3 发出 HTTP POST 来邀请多个用户。这两个都需要 create_event 权限,如果邀请成功则返回 true。
您的附带问题的答案在这里: 将图像附加到 Facebook 事件(php sdk、rest 或 graph api)
see Inviting selected users to Facebook-Event (via Graph API)
Facebook now has a graph api for inviting friends to events.
http://developers.facebook.com/docs/reference/api/event/
invited
Create
You can invite users to an event by issuing an HTTP POST to /EVENT_ID/invited/USER_ID. You can invite multiple users by issuing an HTTP POST to /EVENT_ID/invited?users=USER_ID1,USER_ID2,USER_ID3. Both of these require the create_event permission and return true if the invite is successful.
And the answer to your side question is here: Attach image to Facebook event (php sdk, rest or graph api)
您还可以使用 javascript sdk:
如果一切正常,它应该记录“true”
you can also use javascript sdk:
if all ok, it should log 'true'