Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Created May 29, 2014 10:10
Show Gist options
  • Save niraj-shah/6bc210ea08e0167b86b6 to your computer and use it in GitHub Desktop.
Save niraj-shah/6bc210ea08e0167b86b6 to your computer and use it in GitHub Desktop.
Posting to Timeline using PHP SDK 4.0.x with additional parameters
<?php
// make api call
$response = (new FacebookRequest(
$session, 'POST', '/me/feed', array(
'name' => 'Facebook API: Posting a Status Update Using PHP SDK 4.0.x',
'caption' => "I'm rewriting old tutorials to work with the new PHP SDK 4.0 and Graph API 2.0.",
'link' => 'https://www.webniraj.com/2014/05/29/facebook-api-p…-php-sdk-4-0-x/',
'message' => 'Check out my new tutorial'
)
))->execute()->getGraphObject()->asArray();
// output response - should include post_id
print_r( $response );
@ivantec
Copy link

ivantec commented Nov 28, 2014

Hi Niraj-shah :), I'm from Mexico, I admire your work, thanks for your knowledge, I have a question, please as deauthorize callback url example php sdk 4.0.x

Greetings from mexico :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment