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.
My code was working fine posting the picture but is NOT posting picture anymore!
Here are the CURL parameters:
I am posting to URL: https://graph.facebook.com/ID/feed
and the POST parameters are:
access_token=TheToken&message=My+Message&picture=ImgUrl
where: access_token is a valid access token message is the message to display on the wall picture is the image associated with the message to display on the wall
The ID is valid and access_token is valid.
Any help is appreciated, Facebook seems to be notorious in changing their API without informing interfacing sites!
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?
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/
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With