title: Creating Facebook event for specific page with FB Graph API
body: <p>I need synchronize events from my CMS to Facebook specific page. I'm trying to create an event for my created page but still have no result. I can simply create events, related to user, but not to page. Code uses <a href="http://github.com/facebook/php-sdk/" rel="noreferrer">Facebook PHP-SDK</a>.</p>
  
  <pre><code>$page_id = '31337';
  $page = $facebook-&gt;api("/{$page_id}");
  $event_data = array(
      'name'          =&gt; 'Event: ' . date("H:m:s"),
      'start_time'    =&gt; time() + 60*60,
      'end_time'      =&gt; time() + 60*60*2,
      'owner'         =&gt; $page
  );
  $post = $facebook-&gt;api("/{$page_id}/events", 'POST', $event_data);
  </code></pre>
  
  <p>After executing this snippet, event is created but as I've said before it belongs to user though 'owner' in given data is page. My app has manage_pages, create_event and publish_stream permissions. What I'm missing?</p>
  
  <p><strong>Solution</strong></p>
  
  <p>At <a href="http://developers.facebook.com/docs/reference/rest/events.create" rel="noreferrer">"OLD REST API"</a> documentation I have found that "new Graph API" still needs parameter <strong>page_id</strong>. So variable $event_data should be like below:</p>
  
  <pre><code>$event_data = array(
      'name'          =&gt; 'Event: ' . date("H:m:s"),
      'start_time'    =&gt; time() + 60*60,
      'end_time'      =&gt; time() + 60*60*2,
      'page_id'       =&gt; $page['id]
  );
  </code></pre>