facebook create_event 在我的应用程序墙上而不是用户墙上发布
我正在尝试在我的网站上提供一种功能,允许用户为他们的预订创建 Facebook 活动。
http://developers.facebook.com/docs/reference/api/event/
现在我正在执行正确的过程:
2) 使用步骤 1 中返回的“代码”请求访问令牌 https://graph.facebook.com/oauth/access_token
3) 使用 access_token 创建事件...
string facebookCreateUri = string.Format("https://graph.facebook.com/{0}/events", loggedInMember.FacebookUID);
var formData = new HttpUrlEncodedForm()
{
{"access_token", accessToken},
{"owner", loggedInMember.FacebookUID},
{"description", "nice event that should be on the owners wall"},
{"name", "event on the users wall"},
{"start_time", "1272718027"},
{"end_time", "1272718027"},
{"location", "rochester"},
{"privacy","OPEN"}
};
HttpContent content = HttpContent.Create(formData);
HttpClient client = new HttpClient();
var response = client.Post(facebookCreateUri, "application/x-www-form-urlencoded", content);
但该事件发布在我的应用程序墙上,而不是用户的墙上。它不应该与认证/access_token 元素有任何关系,因为我使用相同的过程在用户墙上发布。 (http://developers.facebook.com/docs/reference/api/status/)并且效果很好。
i'm attempting to provide a facility on my site that allows a user to create a facebook event for their booking.
http://developers.facebook.com/docs/reference/api/event/
now im doing the correct process:
1) first getting authorisation from the user
https://graph.facebook.com/oauth/authorize?client_id=APP_ID&redirect_uri=http://urlimredirectingto.comtype=web_server
2) requesting for an access token with the "code" that is returned in step 1
https://graph.facebook.com/oauth/access_token
3) using the access_token to create the event ...
string facebookCreateUri = string.Format("https://graph.facebook.com/{0}/events", loggedInMember.FacebookUID);
var formData = new HttpUrlEncodedForm()
{
{"access_token", accessToken},
{"owner", loggedInMember.FacebookUID},
{"description", "nice event that should be on the owners wall"},
{"name", "event on the users wall"},
{"start_time", "1272718027"},
{"end_time", "1272718027"},
{"location", "rochester"},
{"privacy","OPEN"}
};
HttpContent content = HttpContent.Create(formData);
HttpClient client = new HttpClient();
var response = client.Post(facebookCreateUri, "application/x-www-form-urlencoded", content);
but the event is posted on my app's wall, not the user's wall. It shouldn't have anything to do with the authentication/access_token elements because i use the same process to post on the user's wall. (http://developers.facebook.com/docs/reference/api/status/) and that works just fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我带着一个解决方案回来了,经过一周使用 Facebook SDK 的许多功能的工作,它终于可以工作了!
对于事件,您必须请求 create_event 权限。
您应该使用 /me/events 来发布您的活动。
我使用 Codeplex 的 C# SDK for Facebook - dld 的最新版本(2011 年 8 月 - v5.2.1)。
祝你好运!
I came back with a solution, after a week of working at many features with Facebook SDK, it finally works!
For events, you have to request the create_event permission.
You should use /me/events to post on your events.
I user the C# SDK for Facebook from Codeplex - last version available for dld (aug 2011 - v5.2.1).
Good luck!
我在您的授权请求中没有看到任何权限。基本权限不足以进行发帖。
我使用:
这是在画布应用程序的上下文中。其中 MY_APP_URL 是应用程序 facebook 的 url:
http://apps.facebook.com/MY_APP_NAME_OR_ID
查看活动的扩展权限并在 文档
[编辑] - 我回来了,抱歉,现在我做了一个测试,确实,它对我有用,但仅限于我在应用程序墙上发布的内容;即使我提供了“user_events”权限,我也会收到此错误:
在用户墙上发布时,远程服务器返回错误:(403) 禁止。
话虽这么说,我也同意这个问题。
I don;t see in your request for Authorization any permission.. base permissions are not enough to do the postings.
i used:
This is in the context of a canvas app. where MY_APP_URL is the url from facebook of the app:
http://apps.facebook.com/MY_APP_NAME_OR_ID
See extended permissions for events and check event's page in documentation
[EDIT] - I came back, sorry, now i did a test, and indeed, it works for me, but only of i post on my app's wall; even if i provided the 'user_events' permission i get this error:
The remote server returned an error: (403) Forbidden when posting on a user's wall.
This being said, i also subscribe to this question.