上传照片时添加no_story = true会导致Graph API失败并出现异常

时间:2015-01-28 10:03:44

标签: php facebook facebook-graph-api file-upload

我想使用官方FB php lib上传带有no_story的图片。

代码如下所示:

    $payload = [
        'message' => 'Hello world!',
        'source' =>new \CURLFile($path, 'image/jpeg','test.jpg'),
        'no_story' => true
    ];

    $post = (
        new FacebookRequest(
            $mySession, 'POST', '/me/photos', $payload
        ))->execute()->getGraphObject()->asArray();

每次我尝试上传时,都会收到FacebookServerException消息An unknown error has occurred消息。

一旦我从有效负载中删除'no_story' => true,它就会开始工作。

我做错了什么?

更准确地说,服务器响应为"{"error":{"message":"An unknown error has occurred.","type":"OAuthException","code":1}}"

0 个答案:

没有答案