ClioSport.net

Register a free account today to become a member!
Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • When you purchase through links on our site, we may earn an affiliate commission. Read more here.

Pulling hair out trying to post to facebook page via website



  Trophy #267
I am trying to integrate a website I run to a newly created facebook page and / or App
Its a fantasy football league which I would like to update regularly.

I have setup the page with me as admin I have also setup an app which, for now, are both called the same thing which i believe they have to be to be linked.

I am trying without success to post via some php to the group.
I have managed to generate my own session key which in turn when used posts as me which i do not want. Also it seems the session key expires fairly quickly so is not a long term answer.
I do understand the user session key is meant to be used to get the page session key which in turn when used with the page id allows you to post as the page.
I cant see this working as 1) i dont want to auth as me and 2) i dont want to have a perm session key as me

This moves onto the app.
I have appid and secret which 'should' allow me to post via the app but I get an error
"message":"(#210) Subject must be a page"

Using code

$data['picture'] = "http://www.example.com/image.jpg";
$data['link'] = "http://www.example.com/";
$data['message'] = "Your message";
$data['caption'] = "Caption";
$data['description'] = "Description";
$data['access_token'] = $app_token2;
$post_url = 'https://graph.facebook.com/'.$app_id.'/feed';
$url1 = "https://graph.facebook.com/endpoint?key=value&access_token=".$app_id."|". $app_secret ;
echo "<br>$post_url";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $post_url);
//curl_setopt($ch, CURLOPT_URL, $url1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$return = curl_exec($ch);
curl_close($ch);
echo "<br>$return";

Any suggestions ?
 


Top