Good afternoon.
I'm starting to study the facebook API and I'm having a hard time getting the URL of the cover photo of some fan page.
I'm not able to mount the get to bring me the information I want.
As the code below I have already generated the token for API access and is accessing normal.
I need help on request. Next code snippet $ request = $ fb-> request ('GET', '/'.$ page_id.' /)
Someone with more API experience can help me.
include 'vendor/autoload.php';
$page_id = '1634111220214490';
$app_id = ''; //Preenchi este valor
$app_secret = ''; //Preenchi este valor
$fb = new \Facebook\Facebook([
'app_id' => $app_id
,'app_secret' => $app_secret
]);
$expires = time()+(60*60)*2; //Auxilia na geração do token
$fbAt = new \Facebook\Authentication\AccessToken($app_id.'|'.$app_secret, $expires);
$token = (string)$fbAt;
$fb->setDefaultAccessToken($token);
//O erro está nesta linha
$request = $fb->request('GET', '/'.$page_id.'/);
$response = $fb->getClient()->sendRequest($request);
$body = $response->getBody();
$obj = json_decode($body);
var_dump($obj);