class People extends Resource (View source)

The "people" collection of methods.

Typical usage is:

 $peopleService = new Google\Service\PeopleService(...);
 $people = $peopleService->people;

Methods

batchCreateContacts(BatchCreateContactsRequest $postBody, array $optParams = [])

Create a batch of new contacts and return the PersonResponses for the newly Mutate requests for the same user should be sent sequentially to avoid increased latency and failures. (people.batchCreateContacts)

batchDeleteContacts(BatchDeleteContactsRequest $postBody, array $optParams = [])

Delete a batch of contacts. Any non-contact data will not be deleted. Mutate requests for the same user should be sent sequentially to avoid increased latency and failures. (people.batchDeleteContacts)

batchUpdateContacts(BatchUpdateContactsRequest $postBody, array $optParams = [])

Update a batch of contacts and return a map of resource names to PersonResponses for the updated contacts. Mutate requests for the same user should be sent sequentially to avoid increased latency and failures.

createContact(Person $postBody, array $optParams = [])

Create a new contact and return the person resource for that contact. The request returns a 400 error if more than one field is specified on a field that is a singleton for contact sources: biographies birthdays * genders

  • names Mutate requests for the same user should be sent sequentially to avoid increased latency and failures. (people.createContact)

deleteContact(string $resourceName, array $optParams = [])

Delete a contact person. Any non-contact data will not be deleted. Mutate requests for the same user should be sent sequentially to avoid increased latency and failures. (people.deleteContact)

deleteContactPhoto(string $resourceName, array $optParams = [])

Delete a contact's photo. Mutate requests for the same user should be done sequentially to avoid // lock contention. (people.deleteContactPhoto)

get(string $resourceName, array $optParams = [])

Provides information about a person by specifying a resource name. Use people/me to indicate the authenticated user. The request returns a 400 error if 'personFields' is not specified. (people.get)

getBatchGet(array $optParams = [])

Provides information about a list of specific people by specifying a list of requested resource names. Use people/me to indicate the authenticated user.

listDirectoryPeople(array $optParams = [])

Provides a list of domain profiles and domain contacts in the authenticated user's domain directory. When the sync_token is specified, resources deleted since the last sync will be returned as a person with PersonMetadata.deleted set to true. When the page_token or sync_token is specified, all other request parameters must match the first call. Writes may have a propagation delay of several minutes for sync requests.

searchContacts(array $optParams = [])

Provides a list of contacts in the authenticated user's grouped contacts that matches the search query. The query matches on a contact's names, nickNames, emailAddresses, phoneNumbers, and organizations fields that are from the CONTACT source. IMPORTANT: Before searching, clients should send a warmup request with an empty query to update the cache. See https://developers.google.com/people/v1/contacts#search_the_users_contacts (people.searchContacts)

searchDirectoryPeople(array $optParams = [])

Provides a list of domain profiles and domain contacts in the authenticated user's domain directory that match the search query.

updateContact(string $resourceName, Person $postBody, array $optParams = [])

Update contact data for an existing contact person. Any non-contact data will not be modified. Any non-contact data in the person to update will be ignored. All fields specified in the update_mask will be replaced. The server returns a 400 error if person.metadata.sources is not specified for the contact to be updated or if there is no contact source. The server returns a 400 error with reason "failedPrecondition" if person.metadata.sources.etag is different than the contact's etag, which indicates the contact has changed since its data was read. Clients should get the latest person and merge their updates into the latest person. The server returns a 400 error if memberships are being updated and there are no contact group memberships specified on the person. The server returns a 400 error if more than one field is specified on a field that is a singleton for contact sources: biographies birthdays genders names Mutate requests for the same user should be sent sequentially to avoid increased latency and failures. (people.updateContact)

updateContactPhoto(string $resourceName, UpdateContactPhotoRequest $postBody, array $optParams = [])

Update a contact's photo. Mutate requests for the same user should be sent sequentially to avoid increased latency and failures.

Details

BatchCreateContactsResponse batchCreateContacts(BatchCreateContactsRequest $postBody, array $optParams = [])

Create a batch of new contacts and return the PersonResponses for the newly Mutate requests for the same user should be sent sequentially to avoid increased latency and failures. (people.batchCreateContacts)

Parameters

BatchCreateContactsRequest $postBody
array $optParams

Optional parameters.

Return Value

BatchCreateContactsResponse

Exceptions

Exception

PeopleEmpty batchDeleteContacts(BatchDeleteContactsRequest $postBody, array $optParams = [])

Delete a batch of contacts. Any non-contact data will not be deleted. Mutate requests for the same user should be sent sequentially to avoid increased latency and failures. (people.batchDeleteContacts)

Parameters

BatchDeleteContactsRequest $postBody
array $optParams

Optional parameters.

Return Value

PeopleEmpty

Exceptions

Exception

BatchUpdateContactsResponse batchUpdateContacts(BatchUpdateContactsRequest $postBody, array $optParams = [])

Update a batch of contacts and return a map of resource names to PersonResponses for the updated contacts. Mutate requests for the same user should be sent sequentially to avoid increased latency and failures.

(people.batchUpdateContacts)

Parameters

BatchUpdateContactsRequest $postBody
array $optParams

Optional parameters.

Return Value

BatchUpdateContactsResponse

Exceptions

Exception

Person createContact(Person $postBody, array $optParams = [])

Create a new contact and return the person resource for that contact. The request returns a 400 error if more than one field is specified on a field that is a singleton for contact sources: biographies birthdays * genders

  • names Mutate requests for the same user should be sent sequentially to avoid increased latency and failures. (people.createContact)

Parameters

Person $postBody
array $optParams

Optional parameters.

Return Value

Person

Exceptions

Exception

PeopleEmpty deleteContact(string $resourceName, array $optParams = [])

Delete a contact person. Any non-contact data will not be deleted. Mutate requests for the same user should be sent sequentially to avoid increased latency and failures. (people.deleteContact)

Parameters

string $resourceName

Required. The resource name of the contact to delete.

array $optParams

Optional parameters.

Return Value

PeopleEmpty

Exceptions

Exception

DeleteContactPhotoResponse deleteContactPhoto(string $resourceName, array $optParams = [])

Delete a contact's photo. Mutate requests for the same user should be done sequentially to avoid // lock contention. (people.deleteContactPhoto)

Parameters

string $resourceName

Required. The resource name of the contact whose photo will be deleted.

array $optParams

Optional parameters.

Return Value

DeleteContactPhotoResponse

Exceptions

Exception

Person get(string $resourceName, array $optParams = [])

Provides information about a person by specifying a resource name. Use people/me to indicate the authenticated user. The request returns a 400 error if 'personFields' is not specified. (people.get)

Parameters

string $resourceName

Required. The resource name of the person to provide information about. - To get information about the authenticated user, specify people/me. - To get information about a google account, specify people/{account_id}. - To get information about a contact, specify the resource name that identifies the contact as returned by people.connections.list.

array $optParams

Optional parameters.

Return Value

Person

Exceptions

Exception

GetPeopleResponse getBatchGet(array $optParams = [])

Provides information about a list of specific people by specifying a list of requested resource names. Use people/me to indicate the authenticated user.

The request returns a 400 error if 'personFields' is not specified. (people.getBatchGet)

Parameters

array $optParams

Optional parameters.

Return Value

GetPeopleResponse

Exceptions

Exception

ListDirectoryPeopleResponse listDirectoryPeople(array $optParams = [])

Provides a list of domain profiles and domain contacts in the authenticated user's domain directory. When the sync_token is specified, resources deleted since the last sync will be returned as a person with PersonMetadata.deleted set to true. When the page_token or sync_token is specified, all other request parameters must match the first call. Writes may have a propagation delay of several minutes for sync requests.

Incremental syncs are not intended for read-after-write use cases. See example usage at List the directory people that have changed. (people.listDirectoryPeople)

Parameters

array $optParams

Optional parameters.

Return Value

ListDirectoryPeopleResponse

Exceptions

Exception

SearchResponse searchContacts(array $optParams = [])

Provides a list of contacts in the authenticated user's grouped contacts that matches the search query. The query matches on a contact's names, nickNames, emailAddresses, phoneNumbers, and organizations fields that are from the CONTACT source. IMPORTANT: Before searching, clients should send a warmup request with an empty query to update the cache. See https://developers.google.com/people/v1/contacts#search_the_users_contacts (people.searchContacts)

Parameters

array $optParams

Optional parameters.

Return Value

SearchResponse

Exceptions

Exception

SearchDirectoryPeopleResponse searchDirectoryPeople(array $optParams = [])

Provides a list of domain profiles and domain contacts in the authenticated user's domain directory that match the search query.

(people.searchDirectoryPeople)

Parameters

array $optParams

Optional parameters.

Return Value

SearchDirectoryPeopleResponse

Exceptions

Exception

Person updateContact(string $resourceName, Person $postBody, array $optParams = [])

Update contact data for an existing contact person. Any non-contact data will not be modified. Any non-contact data in the person to update will be ignored. All fields specified in the update_mask will be replaced. The server returns a 400 error if person.metadata.sources is not specified for the contact to be updated or if there is no contact source. The server returns a 400 error with reason "failedPrecondition" if person.metadata.sources.etag is different than the contact's etag, which indicates the contact has changed since its data was read. Clients should get the latest person and merge their updates into the latest person. The server returns a 400 error if memberships are being updated and there are no contact group memberships specified on the person. The server returns a 400 error if more than one field is specified on a field that is a singleton for contact sources: biographies birthdays genders names Mutate requests for the same user should be sent sequentially to avoid increased latency and failures. (people.updateContact)

Parameters

string $resourceName

The resource name for the person, assigned by the server. An ASCII string in the form of people/{person_id}.

Person $postBody
array $optParams

Optional parameters.

Return Value

Person

Exceptions

Exception

UpdateContactPhotoResponse updateContactPhoto(string $resourceName, UpdateContactPhotoRequest $postBody, array $optParams = [])

Update a contact's photo. Mutate requests for the same user should be sent sequentially to avoid increased latency and failures.

(people.updateContactPhoto)

Parameters

string $resourceName

Required. Person resource name

UpdateContactPhotoRequest $postBody
array $optParams

Optional parameters.

Return Value

UpdateContactPhotoResponse

Exceptions

Exception