User must have accepted TOS - Facebook Graph API error when posting photos to group page

蓝咒 提交于 2019-12-12 13:15:27

问题


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.


回答1:


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

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



来源:https://stackoverflow.com/questions/3069906/user-must-have-accepted-tos-facebook-graph-api-error-when-posting-photos-to-gr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!