如何使用新的 Graph API 添加 Facebook 事件
我正在尝试使用 Facebook api 创建一个事件。 (来自 django 应用程序)有人使用新的图形 API 创建了事件吗?
I am trying to create an event using Facebooks api. (From a django app) Has anyone created an event with the new graph api?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
检查这里:
http://developers.facebook.com/docs/api#publishing
进行 POST 调用到 /PROFILE_ID/events 并提供所需信息。不幸的是,他们没有列出所有可能的参数,但可以在 Events.create。
Check here:
http://developers.facebook.com/docs/api#publishing
Make a POST call to /PROFILE_ID/events with the required informations. Unfortunately they don't have all the possible arguments listed, but they can be found in the REST API docs under Events.create.
要创建事件,您可以使用以下代码:(需要 create_event 权限才能实现您的要求)
To Create Event you can use below code: (Which require create_event permission to achieve your requirement)
如果您需要在用户不在线时访问用户数据,则可以使用offline_access 扩展权限,它可以为您提供更长寿命的会话密钥。这可用于在用户离线时执行更新。
虽然我无法帮助您使用 Django,但大多数 Graph API 似乎确实适合我(不幸的是没有尝试过事件),但似乎记录得很糟糕。
If you require access to user data while the user is not online, there is the offline_access extended privilege which gives you a longer lived session key. This can be used to perform updates while the user is offline.
While I can't help you with Django, most of the Graph API does seem to work for me (not tried events unfortunately) but just seems badly documented.
新文档中似乎没有记录创建 API 的方法,但您可以使用此处描述的 REST 接口方法:http://developers.facebook.com/docs/reference/rest/ 。
目前对我来说最重要的问题是需要用户会话来运行任何 REST 接口。我对 Facebook 的许多请求(活动创建、邀请)在 Facebook 活跃用户登录期间不会运行。它们需要从应用程序创建。
目前我还不确定这是否是新 API 中的限制,或者只是未在 SDK 中实现。
There appears to be no documented method for creating an API in the new docs, but you can use the REST interface methods as described here: http://developers.facebook.com/docs/reference/rest/ .
The big show stopper for me at the moment is the requirement of a user session to run any of the REST interfaces. A lot of my requests to Facebook (Event creations, invites) do not run during an active Facebook user logged in. They need to be created from the Application.
I'm not sure as of yet if this is a limitation in the new API or just not implemented in the SDKs.