I am trying to query for user profile information registered through Google OAuth. My request is formed correctly, I log in successfully, but when I try to make the next request in PHP, I get the error message Request Mask cannot be empty. Allowed paths: ...
However, from the Google People API documentation. that the values of the request mask are optional, and if they are not passed, it will return all values except for people.connections.list . Here is my code:
$service = new Google_Service_People($this->client);
try {
$results = $service->people->get('people/me');
} catch(\Exception $exception) {
echo $exception->getMessage();
exit;
}
Here is the error message I get from this error:
{ "error": { "code": 400, "message": "Request mask can not be empty. Valid paths are: [person.addresses, person.age_ranges, person.biographies, person.birthdays, person.bragging_rights, person.cover_photos, person.email_addresses, person.events, person.genders, person.im_clients, person.interests, person.locales, person.memberships, person.metadata, person.names, person.nicknames, person.occupations, person.organizations, person.phone_numbers, person.photos, person.relations, person.relationship_interests, person.relationship_statuses, person.residences, person.skills, person.taglines, person.urls].", "errors": [ { "message": "Request mask can not be empty. Valid paths are: [person.addresses, person.age_ranges, person.biographies, person.birthdays, person.bragging_rights, person.cover_photos, person.email_addresses, person.events, person.genders, person.im_clients, person.interests, person.locales, person.memberships, person.metadata, person.names, person.nicknames, person.occupations, person.organizations, person.phone_numbers, person.photos, person.relations, person.relationship_interests, person.relationship_statuses, person.residences, person.skills, person.taglines, person.urls].", "domain": "global", "reason": "badRequest" } ], "status": "INVALID_ARGUMENT" } }
Can anyone help me out?
Update 1:
- , $service->people->get('people/me', array("person.names"));
: Illegal string offset 'type'