活动邀请在 Graph 或 Rest API 中不起作用

发布于 2024-12-28 04:50:58 字数 883 浏览 0 评论 0原文

我无法从 Graph 或 REST API 发送活动邀请。我最初尝试通过 Graph API 来完成此操作,但在看到以下问题后,我决定尝试 REST API。

如何邀请用户朋友参加事件? Facebook Graph API

当我尝试使用 PHP SDK 中的 Graph API 时...

$facebook->api('/' . $event_id . '/invited/?users=' . $friend_ids_string, 'POST');

其中 $friend_ids_string 是用户 ID 字符串“user_id1,user_id2,user_id3”,我收到以下错误:“致命错误:未捕获” OAuthException: (#200) 权限错误”

当我使用通过 Graph API 调用的 REST API 时:

$facebook->api(array(
  'method' => 'events.invite',
  'eid' => $event_id,
  'uids' => $friend_ids,
));

我收到基本上相同的错误:“致命错误:未捕获的异常: 200:权限错误”。

我已验证我的应用程序具有所有必要的权限集(create_event、rsvp_event、user_events、friends_events),并且我只是尝试将受邀者添加到我的应用程序创建的活动中。

有谁知道可能导致此问题的原因或解决方法?

I'm not able to send event invitations from either the Graph or REST API. I initially was trying to do it through the Graph API, but after seeing the following question I decided to try the REST API.

How to invite a users friends to an event? Facebook Graph API

When I attempt to use the Graph API from the PHP SDK as such..

$facebook->api('/' . $event_id . '/invited/?users=' . $friend_ids_string, 'POST');

where $friend_ids_string is a string of user ids "user_id1,user_id2,user_id3" I receive the following error: "Fatal error: Uncaught OAuthException: (#200) Permissions error"

When I use the REST API called through the Graph API:

$facebook->api(array(
  'method' => 'events.invite',
  'eid' => $event_id,
  'uids' => $friend_ids,
));

I receive basically the same error: "Fatal error: Uncaught Exception: 200: Permissions error".

I have verified that my application has all of the necessary permissions set (create_event, rsvp_event,user_events,friends_events), and I'm only trying to add invitees to an event that was created by my app.

Does anyone know what could be causing this or a good work around?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

彩扇题诗 2025-01-04 04:50:58

这只是部分答案。

我注意到,每当您尝试邀请的用户之一已被邀请时,整个 POST 就会失败并出现 #200 错误。因此,您需要将逗号分隔字符串中的用户与已受邀参加活动的用户进行检查。

然而,即使我这样做,有时仍然会失败。

所以我不确定完整的答案是什么。

也许您一次可以发布的数量有限制。也许您尝试邀请的用户之一过去已经阻止了您的用户 - 我想知道我们如何检查这一点。

This is only a partial answer.

I noticed that whenever one of the users that you are trying to invite are already invited then the entire POST fails with a #200 error. So you need to check the users in your coma delimited string against the users already invited to the event.

However even if I do that it still fails sometimes.

So I am not sure what the complete answer is.

Maybe there's a limit to how many you can post at once. Maybe one of the users that you are trying to invite has blocked your user in the past - I wonder how we could check this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文