如何使用Facebook Graph API编辑现有事件 [英] How to edit an existing event using the Facebook Graph API

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

问题描述

我对此进行了广泛的研究,并感到困惑.简而言之,RTFM回答了有关stackoverflow的类似问题.好吧,我已经做了很多,但仍然找不到如何做到这一点.

I've done extensive research on this, and am baffled. Similar questions on stackoverflow have been answered with, in in short: RTFM. Well, I've done that, and more, and I still can't find how to do this.

在FB Graph API主页上,提供了有关身份验证,读取,发布(创建),删除Graph对象的文档,但我看不到在任何地方进行修改.

On the main FB Graph API page, documentation is given for authenticating, reading, publishing (creating), deleting Graph objects, but I don't see modifying anywhere.

FB Graph API>用户页仅提供有关如何代表经过身份验证的用户创建和删除事件.这两个动作我都没问题.

The FB Graph API > User page gives description only of how to create and delete an event on behalf of an authenticated user. I've had no problem with these two actions.

FB Graph API>事件告诉您如何检索现有的事件,以及发布到现有事件,帖子,链接,提要等.再次,修改无济于事.

The FB Graph API > Event tells you how to retrieve an existing event, as well as publish to the existing event, posts, links, feed, etc. Once again, no help with modifying.

我已经尝试过(拼命地)(由于超链接的限制,故意删除了'::)

I've tried (desperately) (':'s removed intentionally due to hyperlink limit):

  1. 发送与创建事件相同的POST请求,即发送到https//graph.facebook.com/< user_id>/events,但带有额外的"id"参数-现有的Facebook事件ID. Facebook不喜欢这样,给我一个"id参数已发送"错误(我假设用户的ID).

  1. Sending the same POST request as creating event, ie to https//graph.facebook.com/<user_id>/events, but with an extra 'id' parameter--the existing facebook event id. Facebook doesn't like that, gives me an 'id parameter already sent' error (I'm assuming the user's id).

使用与创建事件相同的auth_token直接发布到事件,即发布到https//graph.facebook.com/< fb_event_id>/. 发布不受支持的"错误消息.

POSTing to the event directly ie to https//graph.facebook.com/<fb_event_id>/ using the same auth_token as was used to create it. 'Post unsupported' error message.

我与POST一起发送的字段与创建事件时使用的字段相同-名称",位置"等.

The fields I send along with the POST are the same as those when creating the event-- 'name', 'location' etc.

如果有人能够做到这一点,那么一个简单的POST示例将为我清除所有内容. 谢谢!

If someone's been able to do this, one simple POST example would clear everything up for me. Thanks!

更新我开始使用PHP SDK,但缺少令人沮丧的示例.希望这可以避免其他人的沮丧.以下是一些示例,其中增加了一个实际的api调用示例:

UPDATE I started using the PHP SDK, but lack of examples disheartening. In hopes that this will save someone else frustration Here are doc examples augmented with an actual api call example:

您可以通过向以下用户发出HTTP POST请求来为用户创建事件: 具有create_event权限和以下内容的PROFILE_ID/事件 参数."

"You can create an event for a user by issuing an HTTP POST request to PROFILE_ID/events with the create_event permissions and the following parameters."

$facebook->api('/'.$profile_id.'/events', 'POST', $params);

足够正常...但是编辑事件文档(截至12/7/12)具有误导性:

Normal enough ... but edit event docs (as of 12/7/12) are misleading:

"您可以通过以下方式对/EVENT_ID发出HTTP POST来编辑事件: create_event权限. "

"You can edit an event by issuing an HTTP POST to /EVENT_ID with the create_event permission. "

$facebook->api('/events/'.$eventid, 'POST', $params);

推荐答案

布莱恩 我可以通过使用帐户或页面身份验证令牌将POST(而非PUT)直接添加到事件中来更新页面事件.听起来就像您在上面2中所做的一样.

Brian I was able to update a page event by using a POST (not a PUT) directly to the event, using the account or page authentication token. It sounds exactly like what you did in 2 above.

curl -F 'access_token=...' \
     -F 'name=A modified event name.' \
     https://graph.facebook.com/event_id

我建议您尝试仅发送修改后的姓名字段.另外,由于您已经创建了事件,因此您具有正确的权限.对于那些不知道的人,您需要具有offline_access,create_event,manage_pages等扩展权限.

I would suggest that you try just sending a modified name field. Also, because you have already created the event, you have the correct permissions. For those who don't know, you need the extended permissions of offline_access, create_event, manage_pages, etc.

令人沮丧的是,因为有一次Facebook网站上有关于更新的文档,但是现在我找不到它.

It is frustrating, because at one time there was documentation on updates on the Facebook site, but now I can't find it.

这篇关于如何使用Facebook Graph API编辑现有事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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