用户必须已接受 TOS - 将照片发布到群组页面时 Facebook Graph API 错误

发布于 2024-09-06 07:45:13 字数 1117 浏览 2 评论 0原文

我一直在努力从用户的计算机上传图像并使用 Facebook Graph API 将图像发布到我们的群组页面。我能够向 facebook 发送带有图像的发布请求,但是,我收到此错误:错误:(#200) 用户必须已接受 TOS。在某种程度上,我不认为我需要用户在照片上传到我们的群组页面时对其进行授权。下面是我正在使用的代码:

    if($albumId != null) {
   $args = array(
    'message' => $description
   );
   $args[basename($photoPath)] = '@' . realpath($photoPath);
   $ch = curl_init();
   $url = 'https://graph.facebook.com/'.$albumId.'/photos?'.$token;
   curl_setopt($ch, CURLOPT_URL, $url);
   curl_setopt($ch, CURLOPT_HEADER, false);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
   curl_setopt($ch, CURLOPT_POST, true);
   curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
   curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
   curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
   $data = curl_exec($ch);

   $photoId = json_decode($data, true);
   if(isset($photoId['error'])) die('ERROR: '.$photoId['error']['message']);
   $temp = explode('.', sprintf('%f', $photoId['id']));
   $photoId = $temp[0];
   return $photoId;
  }

有人可以告诉我是否需要向用户请求额外的权限或者我做错了什么?

非常感谢!


事实上,我从来没有成功过:(。作为解决办法,我们创建了一个新的 Facebook 用户而不是群组页面。

I've been struggling to upload an image from the user's computer and posted to our group page using the Facebook Graph API. I was able to send a post request to facebook with the image however, I'm getting this error back: ERROR: (#200) User must have accepted TOS. To some extent, I don't believe that I need the user to authorize himself as the photo is being uploaded to our group page. This below, is the code i'm using:

    if($albumId != null) {
   $args = array(
    'message' => $description
   );
   $args[basename($photoPath)] = '@' . realpath($photoPath);
   $ch = curl_init();
   $url = 'https://graph.facebook.com/'.$albumId.'/photos?'.$token;
   curl_setopt($ch, CURLOPT_URL, $url);
   curl_setopt($ch, CURLOPT_HEADER, false);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
   curl_setopt($ch, CURLOPT_POST, true);
   curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
   curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
   curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
   $data = curl_exec($ch);

   $photoId = json_decode($data, true);
   if(isset($photoId['error'])) die('ERROR: '.$photoId['error']['message']);
   $temp = explode('.', sprintf('%f', $photoId['id']));
   $photoId = $temp[0];
   return $photoId;
  }

Can somebody tell me if I need to request extra permissions from the user or what i'm doing wrong?

Thanks very much!


Actually, I never succeeded in this :(. As a work around, we created a new facebook user instead of a group page.

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

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

发布评论

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

评论(1

﹉夏雨初晴づ 2024-09-13 07:45:13

这是一个已知的错误,看起来他们正在解决这个问题:

http: //bugs.developers.facebook.net/show_bug.cgi?id=11254

This is a known bug and it looks like they're working on it:

http://bugs.developers.facebook.net/show_bug.cgi?id=11254

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