Skip to content

Instantly share code, notes, and snippets.

@nguyenvanduocit
Created June 2, 2014 20:16
Show Gist options
  • Save nguyenvanduocit/a106bf221c1c6334e3a2 to your computer and use it in GitHub Desktop.
Save nguyenvanduocit/a106bf221c1c6334e3a2 to your computer and use it in GitHub Desktop.
<?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://muatocroi.com',
'message' => 'Check out my new tutorial'
)
))->execute()->getGraphObject()->asArray();
// output response - should include post_id
print_r( $response );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment