UPDATE
Creating an event using the API is no longer possible in version 2.0. Check out: https://developers.facebook.com/docs/apps/changelog#v2_0
Yes it is possible.
Permissions:
So, first you get the page id and access token through:
$facebook->api("/me/accounts");
The result will be something like this:
Array ( [data] => Array ( [0] => Array ( [name] => Page Name [category] => Website [id] => XXXXXX [access_token] => XXXXX ) [1] => Array ( [name] => Page Name 2 [category] => Company [id] => XXXXXXX [access_token] => XXXXXXXX ) ) )
UPDATE:. To get the access_token page, you can now call the page object directly like this:
$page_info = $facebook->api("/PAGE_ID?fields=access_token");
Access to the token on a successful call must be available: $page_info['access_token']
Now you get the page id and access token and use the events connection:
$nextWeek = time() + (7 * 24 * 60 * 60); $event_param = array( "access_token" => "XXXXXXXX", "name" => "My Page Event", "start_time" => $nextWeek, "location" => "Beirut" ); $event_id = $facebook->api("/PAGE_ID/events", "POST", $event_param);
And you're done !:-)
source share