Kumidan Posted June 19, 2015 Share Posted June 19, 2015 I've got a website where users can fill a form, the web application stores the data into the database.Those data are used to create contents on the site.As a user submits the form, I want to post a link to the Facebook page related to the website, but not in name of the user, but as the page itself.I've read a lot of tutorials around, but I couldn't have this working.This is my code at the moment, but of course it doesn't work FacebookSession::setDefaultApplication($app_id, $app_secret); $session = FacebookSession::newAppSession(); try { $session->validate(); } catch (FacebookRequestException $ex) { echo $ex->getMessage(); } catch (\Exception $ex) { echo $ex->getMessage(); } if($session) { try { $response = (new FacebookRequest( $session, 'POST', '/me/feed', array( 'link' => 'www.mysite.it', 'message' => 'some text' ) ))->execute()->getGraphObject(); echo "Posted with id: " . $response->getProperty('id'); } catch(FacebookRequestException $e) { echo "Exception occured, code: " . $e->getCode() . " with message: " . $e->getMessage(); } } What I get is this error message: "Exception occured, code: 2500 with message: An active access token must be used to query information about the current user." As I've understood I miss to login as the page, but I can't uderstand how to do so.Could any one tell me how to chenge the code? Link to comment https://forums.phpfreaks.com/topic/296928-laravel5-post-links-to-my-facebook-page-as-the-page-itself/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.