This week, we launched the improved auth dialog and over 60 new Open Graph apps.
We are now approving Open Graph Actions. If you are new to the Open Graph, please review the Tutorial on how to use the Open Graph to integrate your app with Facebook. Please review and check your Actions against the required criteria prior to submission.
We recently announced the ability to read questions via the Graph API. We are now adding the option to write them. To create a question for the current user, issue an HTTP POST to the questions connection like this:
curl -F 'access_token=...' \ -F 'question=What is your favorite color?' \ https://graph.facebook.com/me/questions
Here's a PHP example that shows the optional parameters: options
and allow_new_options
-- and how to post a question as a Page using its access token:
<?php
$question = 'What are you doing this weekend?';
$options = json_encode(array('Hiking','Watching a movie','Hacking'));
$page_id = 'YOUR_PAGE_ID';
$app_id = 'YOUR_APP_ID';
$app_secret = 'YOUR_APP_SECRET';
$my_url = 'YOUR_URL';
$code = $_REQUEST["code"];
echo '<html><body>';
if (!$code) {
// manage_pages permissions is required for accounts the user
// has access to, and posting to the Page
$dialog_url = "http://www.facebook.com/dialog/oauth?client_id="
. $app_id . "&redirect_uri=" . urlencode($my_url)
. "&scope=manage_pages";
echo('<script>top.location.href="' . $dialog_url . '";</script>');
} else {
$token_url = "https://graph.facebook.com/oauth/access_token?client_id="
. $app_id . "&redirect_uri=" . urlencode($my_url)
. "&client_secret=" . $app_secret
. "&code=" . $code;
$access_token = file_get_contents($token_url);
$accounts_url =
"https://graph.facebook.com/me/accounts?" . $access_token;
$response = file_get_contents($accounts_url);
// Parse the return value and get the array of accounts - this is
// returned in the data[] array.
$resp_obj = json_decode($response,true);
$accounts = $resp_obj['data'];
// Find the access token for the Page
$page_access_token = '';
foreach($accounts as $account) {
if($account['id'] == $page_id) {
$page_access_token = 'access_token=' . $account['access_token'];
break;
}
}
// Post the question to the Page
$post_question_url =
"https://graph.facebook.com/" . $page_id . '/questions' .
"?question=" . urlencode($question) .
'&options=' . urlencode($options) .
'&allow_new_options=false' .
"&method=post&" . $page_access_token;
echo file_get_contents ($post_question_url);
}
echo '</body></html>';
?>
Questions may be removed by issuing an HTTP DELETE to their id. More information is available in the Question documentation, User documentation, and Page documentation.
We recently built an Email Settings dashboard that lets you easily manage your subscriptions to the Developer and HTML5 blog. To access your email settings, click on the arrow on the top right and select "Email Settings."
We want to help you more quickly access the information you need on the Developer Site. The search typeahead now includes Bugs along with Apps and Documentation.
We added two policy training videos to help new developers better understand our Platform Policies and Promotion Guidelines.
Please refer to the Platform Roadmap for more info.
feed
for pages, documentation states it shouldActivity on facebook.stackoverflow.com this week: