facebook graph api don´t publish to news feed

Posted by rizidoro on Stack Overflow See other posts from Stack Overflow or by rizidoro
Published on 2010-04-28T18:03:17Z Indexed on 2010/04/28 18:07 UTC
Read the original article Hit count: 297

Filed under:
|
|

hi, im trying to update my news feed on facebook. Im using the new graph api. I can connect to graph, but when i try to publish some content to the feed object, nothing happens.

here´s my code:

<?php   
$token = "xxxx";

$fields = "message=test&access_token=$token";

$c = curl_init("http://graph.facebook.com/me/feed");
curl_setopt($c,"CURLOPT_POST", true);
curl_setopt($c,"CURLOPT_POSTFIELDS",$fields);

$r = curl_exec($c);
print_r($r);

this returns:

{"error":{"type":"QueryParseException","message":"An active access token must be used to query information about the current user."}}1

then I try to pass access_token via GET:

$c = curl_init("http://graph.facebook.com/me/feed?access_token=$token");

this returns:

{"data":[]}1

Am I doing something wrong?

thanks

© Stack Overflow or respective owner

Related posts about php

Related posts about facebook