I am getting error when calling google sign in API. Error is
"Legacy People API has not been used in project ************ before or it is disabled"
But the people API is enable. How to solve this error ?
This is my google api url is this is sufficient to solve my problem
if (empty($_POST['google_key'])) {
$error_code = 5;
$error_message = 'google_key (POST) is missing';
} else {
$app_key = $_POST['google_key'];
// https://www.googleapis.com/plus/v1/people/me?access_token={$access_token}&key={$app_key}
$get_user_details = fetchDataFromURL("https://people.googleapis.com/v1/people/me?access_token={$access_token}&key={$app_key}");
$json_data = json_decode($get_user_details);
if (!empty($json_data->error)) {
$error_code = 4;
$error_message = $json_data->error;
} else if (!empty($json_data->id)) {
$social_id = $json_data->id;
$social_email = $json_data->emails[0]->value;
$social_name = $json_data->displayName;
if (empty($social_email)) {
$social_email = 'go_' . $social_id . '@google.com';
}
}
}
this is my code where m using app key as google key and the access token now explain me where's the problem