After you've completed the steps in Get Ready to Use the People API you are ready to read and manage contacts.
- On February 12, 2019, old Contacts will be turned off completely, and any remaining users will be moved to new Contacts. There will be no option to use the o.
- Google Pixel System Update. Now your Pixel is going to check for an update. It might not actually find one, depending on if it has been pushed to your device or not.
The next steps will help you consolidate your contacts into Google's ecosystem instead. Wherever your contacts are, with the Google Drive app, you can push your Contacts data from your iCloud or those that are locally stored to the Google Drive and into Google Contacts. Move your iPhone Contacts to Google Contacts with the Google Drive app.
The following code samples demonstrate how to send a few simple requests:
- List the user's contacts.
- Search the user's contacts.
- Create a new contact.
- Update an existing contact.
- Delete an existing contact.
- Batch create new contacts.
- Batch update existing contacts.
- Batch delete existing contacts.
For a full list of methods, see the referencedocumentation.
Only contact based people can be modified. Profile based people read using resource name'people/me'
or by an account ID can not be modified.
List the user's contacts
To get a list ofpeople in the user's contacts, use the following code:
You can get a list of only changed contacts by settingrequestSyncToken
to true
in the request, and then using the syncToken
returned in the response in the syncToken
param for the next request. Sync tokens expire after 7 days, and will result in a 410 error. To handle that error, clients should send a request without the syncToken
to get the full list of contacts.Search the user's contacts
To search all of the user's contacts, use the following code:
Protocol
Java
Create a new contact
To create a new contact, use the following code:
Google Update My Contacts Free
Update an existing contact
To update an existing contact, you mustinclude the person.metadata.sources.etag
field in the person for the contact to beupdated to make sure the contact has not changed since your last read. Use the following code:
Protocol
Java
Delete an existing contact
To delete an existing contact, use the following code:
Batch create new contacts
To batch create new contacts, use the following code:
Protocol
Java
Batch update existing contacts
Google Update My Contacts Manager
To update an existing contact, you mustinclude the person.metadata.sources.etag
field in each person for the contact to beupdated to make sure the contact has not changed since your last read. Use the following code:
Batch delete existing contacts
To batch delete existing contacts, use the following code: