Picture posting NOT working with Facebook Graph API
The message is posted but the picture is NOT.
I am using the Graph API to post to the wall on Facebook.
Posting picture works for me but somehow including a source (swf) causes the picture to not display anymore. This used to work until last week.
Ken, but what if you want link= to point to something else? this works:
curl -F \
"picture=http://tycho.usno.navy.mil/gif/moons/m146.gif" \
-F "message=you're looking great tonight!" \
-F "name=Current Moon Phase" \
-F "link=http://www.calculatorcat.com/moon_phases/phasenow.php" -F caption="How the moon appears tonight" \
-F "access_token=111111111111111|2222222222222222222222222|33333333333333333333456n" \
"https://graph.facebook.com/215958041750734/feed"
you can see result at: https://www.facebook.com/pages/The-Moon/215958041750734
works for me using source parameter:
$graph_url= "https://graph.facebook.com/me/feed?"
. "source=" . urlencode($_POST["picture"])
. "&link=" . urlencode($_POST["link"])
. "&message=" . urlencode($_POST['message'])
. "&method=POST"
. "&access_token=" .$access_token;
$response=file_get_contents($graph_url);
$json=json_decode($response);
I used the LINK parameter instead of the PICTURE parameter and all seems to be working now. Facebook changed something in regards to the PICTURE parameter where it stopped working. I did NOT change any code on my system and it just stopped working. See http://developers.facebook.com/docs/reference/api/post/
I had the same problem when posting using the graph api via PHP. Dont know what the cause what, but my image URLs contained a - sign (http://the.url/to/the-image.jpg). After renaming the images, everything worked as expected.
What is your image url?
Wait for it
I noticed that it takes more time for Facebook to process the picture (up to 15 minutes) than to post the link on the timeline (instant).