简体   繁体   English

使用FB图API更改组封面图像

[英]Changing group cover image using fb graph api

I want to change the cover image of group created via graph API. 我想更改通过图形API创建的组的封面图像。 Here is the code that I used but it give me error. 这是我使用的代码,但它给了我错误。 I am using app access token. 我正在使用应用程序访问令牌。

$response = $facebook->api('/Groupid', "POST", 
    array (
        'access_token' => $app_token,
        'cover_url' => 'calnder.png'
    )
);

Fatal error: Uncaught OAuthException: An unknown error has occurred. 致命错误:未捕获的OAuthException:发生未知错误。 thrown in /home/groupsme/public_html/base_facebook.php on line 959 在第959行的/home/groupsme/public_html/base_facebook.php中抛出

Can somebody tell me about my fault please ? 有人可以告诉我我的错吗?

I think the cover_url should be an absolute path to an image. 我认为cover_url应该是图像的绝对路径。

Please test it via Graph explorer first. 请先通过Graph Explorer对其进行测试。 Access token will be app token means 访问令牌将是应用令牌的意思

$app_token = $app_id | $app_secret;
$cover_url = "http://dummyimage.com/600x400/000/fff";

then do this 然后做这个

$response = $facebook->api('/GROUP_ID', "POST", array ( 'access_token' => $app_token,'cover_url' => $cover_url ));
print_r($response);

For reference see the graph explorer screenshot 供参考,请参阅图形资源管理器屏幕截图

图浏览器的屏幕截图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM