Answer the question
In order to leave comments, you need to log in
How to get information about a user using the Facebook API?
Hello dear. Such a thing, you need to get information about the user. We will assume that we need a method to which I send a link to the user's FB, and in response he gives me information about him, by type of name, date of birth, link to the profile picture)
VK example:
$info = file_get_contents('https://api.vk.com/method/users.get?user_ids='.$userID.'&fields=photo_max,bdate,city&v=5.130&lang=ru&access_token='.$VK_TOKEN);
Answer the question
In order to leave comments, you need to log in
one.
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/{person-id}/',
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question