Gabo
Gabo

Reputation: 359

Koala Facebook error 500 when I use put_picture

I'been trying to publish a photo in my ruby app using Koala Facebook. I read lots and lots of sites and posts but I couldn't reach the solution. This is the code I have:

@graph = Koala::Facebook::API.new(credentials.token)
albums = @graph.get_connections('me', 'albums') 
albuminfo = @graph.put_object('me','albums', :name=>'MyAppAlbum')
album_id = albuminfo["id"]

cover = @graph.put_picture(image_url)
cover_id = cover ["id]"
CoverSocialService.new(cover).upload_facebook_cover_picture(session[:fb_credentials], path_to_url(@cover.filtered_url))

redirect_to "https://www.facebook.com/profile.php?preview_cover=#{cover_id}"

This gives me the error:

Type: OAuthException, code: 1, message: An unknown error has occurred. [HTTP 500]

n line:

cover = @graph.put_picture(image_url)

I already tried with a different thread. I already checkd my permissions: photo_upload, publish_stream, user_photos.

The script creates MyAppAlbum correctly but I just cannot publish the photo.

Photo's size is lower than 700px x 700 px and 800kb

Thank you very much in advance

Upvotes: 1

Views: 408

Answers (1)

okeen
okeen

Reputation: 3986

Check out that image_url is a valid, publicly accessible URL. I made that mistake...

Upvotes: 1

Related Questions