简体   繁体   中英

Setting a groups cover image using the Facebook Graph API

I've been visiting this forum for years, but this is my first ever question. Any help would be appreciated!

I am writing a web service to pass groups from one application into Facebook and invite the authorised people into them and set a nice pretty cover photo that is generated and stored within the application.

The group creation works splendidly after a fair old bit of head scratching, however, when I try to set the cover image, I am getting a rather useful error message back as below.

OAuth "Facebook Platform" "unknown_error" "An unknown error has occurred."

It's a PHP application on Code Igniter. According to Facebook's delightfully accurate API documentation , this is a simple matter of a cUrl post to 'graph.facebook.com/$groupId' passing the same auth token I just used to create the group and perform the invites and a single JSON encoded parameter of 'cover_url' => $urlOfImage .

A simple task in theory, however, I have spent all day today and a significant chunk of yesterday trying to get this to work without much success.

I have tried posting the image as a Curl object as is necessary in other areas of the Facebook API, and it appears to be trying giving me an error that the image is generating a 404 error (it isn't, when I checked the access logs, it was never requested).

Please be someone out there who has had some success with this.

这已由Facebook修复

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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