I would like to post a photo to the Timeline of a Facebook Page via Graph API. My setup is node-based and written in coffeescript. My current implementation is this (error handling ommited):
sendImageToFacebookTimeline = (user, message, imageURL, callback)->
url = "https://graph.facebook.com/#{pageID}/photos"
params =
access_token: user.accessToken
url: imageURL
message: message
request.post({url: url, qs: params}, (err, res, body)->
body = JSON.parse(body)
callback(body.id)
)
This succesfully posts the photo to my Page. But instead of appearing on the timeline it appears in the "Photos of PAGE".
How can I post to the Timeline?
EDIT: I found out that by posting to /page_id/feed with option "picture" you can send a photo to Timeline. This shows up the same way as og:image and the view is similar to a link.
EDIT 2: If you upload to a album, it will show up on Timeline. I have created an album and trying to post to it. But the API doesn't seem to accept URL for source when posting to /album_id/photos.