SecureCloud-biz
7/12/2014 - 10:54 PM

Using a ID from taggable_friends to post Status Update using Graph API 2.0 and Facebook PHP SDK 4.0.x

Using a ID from taggable_friends to post Status Update using Graph API 2.0 and Facebook PHP SDK 4.0.x

<?php
 
// requires Facebook PHP SDK 4.0.x or later
 
// user must be logged-in prior to API call
 
// publish story, requires 'places' attribute
// use a page_id with no address to tag hidden location
// $tags is a comma-separated string of IDs
$story = (new FacebookRequest( $session, 'POST', '/me/feed', array(
              'message' => 'test', 'tags' => $tags, 'place' => '195383960551614'
            ) ))->execute()->getGraphObject()->asArray();
 
// returns post_id
echo '<pre>' . print_r( $story, 1 ) . '</pre>';