(PHP) Using Facebook Export API, I want to download data but when I send post request to v2.* or v3.0 of the api, the errror message written in the title of this question pops up for both of them.
Although according to facebook export api documentation (https://developers.facebook.com/docs/analytics/export) the versions below 3.0 are deprecated but they would continue working till August 01, 2018. So why does this error comes for even version 2.* now?
My code is give below.
Can Anyone guide me?
$body['access_token'] = $access_token;
$body['start_ts'] = time();
$body['end_ts'] = time()+(60*60);
$end_point = 'analytics_app_events_exports';
$graph_version = 'v2.12';
$fb = new \Facebook\Facebook([
'app_id' => $app_id,
'app_secret' => $app_secret,
'default_graph_version' => $graph_version,
'default_access_token' => $access_token, // optional
]);
$fb_req = new \Facebook\FacebookRequest($fb->getApp(), $access_token, "POST", $app_id.'/'.$end_point, $body, NULL, $graph_version);
try{
$fb_client = $fb->getClient();
$fb_res = $fb_client->sendRequest($fb_req);
echo $fb_res;
}
catch(\Facebook\Exceptions\FacebookResponseException $e){
echo $e->getMessage().'<br>';
}