google-api-php-client-services icon indicating copy to clipboard operation
google-api-php-client-services copied to clipboard

Required parameter personFields is missing from people_connections->listPeopleConnections

Open jvdyck opened this issue 8 years ago • 4 comments

Without parameter personFields: $contactsvc->people_connections->listPeopleConnections("people/me", ["pageSize"=>10]);

The request gives you following error:

Google_Service_Exception
{
	"error":
	{
		"code": 400,
		"message": "personFields mask is required. Please specify one or more valid paths. Valid paths are documented at https://developers.google.com/people/api/rest/v1/people/get.",
		"errors": [...],
		"status": "INVALID_ARGUMENT"
	}
}

This is normal because the personFields parameter is required. See the API reference.

With parameter personFields: $contactsvc->people_connections->listPeopleConnections("people/me", ["pageSize"=>10, "personFields"=>"names,emailAddresses"]);

You get the following error in the client itself:

Google_Exception
(list) unknown parameter: 'personFields'

The solution is to add the personFields parameter to People.php. This gives the correct result: Google_Service_People_ListConnectionsResponse containing the requested contacts.

jvdyck avatar Aug 22 '18 12:08 jvdyck

This issue has been fixed in the API.

jdpedrie avatar Jun 07 '19 15:06 jdpedrie

Hello,

I still have the same error, Google_Exception (list) unknown parameter: 'personFields'.

There is a discussion on StackOverflow about this.

I check the official document and it say "requestMask.includeField is already DEPRECATED." but it still in api's code by somehow.

drasill avatar Sep 10 '19 14:09 drasill

I didn't have time to try this until now. @drasill you're right, this problem doesn't seem to be solved at all. Please reopen this issue. I could send a PR with the changes for People.php, but I think these code files get generated somehow, so that won't help...

jvdyck avatar Oct 01 '19 14:10 jvdyck

Ping. Same problem for me.

cbeyer avatar Mar 01 '21 09:03 cbeyer