アプリケーションで作成した既存の Facebook イベントを更新しようとしています。イベントを作成するために PHP SDK を使用しています。イベントを作成するためのコードは次のとおりです。
$access_token = $facebook->getAccessToken();
$page_id = $_SESSION['FAN_PAGE_ID'];
// Now, getting the PAGE Access token, using the user access token
$page_token_url = "https://graph.facebook.com/$page_id?fields=access_token&" . $access_token;
$response = file_get_contents($page_token_url);
// Parse the return value and get the Page access token
$resp_obj = json_decode($response,true);
$page_access_token = $resp_obj['access_token'];
$event_param = array(
"access_token" =>$page_access_token,
"name" => $postEventName,
"start_time" => $postEventDate,
"page_id" => $postFanPageID,
"description" => $eventDescription,
"location" => $location
);
try
{
$fb_event_id = $facebook->api("/$postFanPageID/events", "POST", $event_param);
}
catch (FacebookApiException $e)
{
echo $e->getMessage();
}
これでイベントが正常に作成されました。しかし、イベントの更新に関するドキュメントは見つかりませんでした。
同じ呼び出しを使用してみましたが、既存のものを提供しましたeventID
:
$facebook->api("/$postFanPageID/events/$facebookEventID", "POST", $event_param);
新しいイベントを作成しました。
私はこれを使ってみました(イベントを削除するコードに似ています):
$facebook->api($facebookEventID, 'UPDATE', $event_param);
しかし、これは戻ってきました:Unsupported method
Facebookによる.
イベントを更新するにはどうすればよいですか? ありがとう。