Update or delete a shared contact

The processes to update or delete a shared contact are similar.

Update a shared contact

When you update an entry, you must preserve all the XML that was present when you retrieved the entry from the server. Otherwise the ignored elements are deleted. Updates can take up to 24 hours to be reflected in the email address auto-complete and the contact manager.

To update an existing shared contact, do the following:

  1. Get the entry that you want to update.
  2. Edit the entry.
  3. Send a PUT request with the updated entry in the message body to the contact's edit URL. Use the application/atom+xml content type and make sure that the <id> value in the updated entry exactly matches the <id> of the existing entry. The edit URL ends with a version number, in order to detect conflicts of updates from different sources. For more information, see versioning.

    Update the entry:

    <entry>
      <id>https://www.google.com/m8/feeds/contacts/DOMAIN/base/8411573</id>
      <updated>2008-02-28T18:47:02.303Z</updated>
      <category scheme='http://schemas.google.com/g/2005#kind'
        term='http://schemas.google.com/contact/2008#contact' />
      <title type='text'>TITLE_NAME</title>
      <gd:name>
        <gd:fullName>FIRST_NAME LAST_NAME</gd:fullName>
      </gd:name>
      <content type='text'>NOTES</content>
      <link rel='self' type='application/atom+xml'
        href='https://www.google.com/m8/feeds/contacts/DOMAIN/PROJECTION/8411573' />
      <link rel='edit' type='application/atom+xml'
        href='https://www.google.com/m8/feeds/contacts/DOMAIN/PROJECTION/8411573/1204224422303000' />
      <gd:phoneNumber rel='http://schemas.google.com/g/2005#other'
        primary='true'>PRIMARY_PHONE_NUMBER</gd:phoneNumber>
      <gd:extendedProperty name="CUSTOM_PROPERTY" value="CUSTOM_PROPRTY_VALUE" />
    </entry>
    

    Replace the following:

    • DOMAIN: The URL for your domain—for example, example.com.
    • TITLE_NAME: A name for the contact entry—for example, example.com contact list.
    • FIRST_NAME: The first name of the shared contact—for example, Alex.
    • LAST_NAME: The last name of the shared contact—for example, Kim.
    • PROJECTION: The projection value that specifies the gd:extendedProperty elements. For a list of supported values, see Projection values.
    • PRIMARY_PHONE_NUMBER: The preferred phone number for the shared contact—for example, (206)555-1212.
    • CUSTOM_PROPERTY: A name for a custom property that you want to store about the shared contact—for example, pet.
    • CUSTOM_PROPRTY_VALUE: A value for a custom property that you want to store about the shared contact—for example, hamster.

      The following is an example of an updated entry for a shared contact with the edit URL highlighted:

      <entry>
      <id>https://www.google.com/m8/feeds/contacts/example.com/base/8411573</id>
      <updated>2008-02-28T18:47:02.303Z</updated>
      <category scheme='http://schemas.google.com/g/2005#kind'
        term='http://schemas.google.com/contact/2008#contact' />
      <title type='text'>Fitzgerald</title>
      <gd:name>
        <gd:fullName>Fitzgerald</gd:fullName>
      </gd:name>
      <content type='text'>Notes</content>
      <link rel='self' type='application/atom+xml'
        href='https://www.google.com/m8/feeds/contacts/example.com/full/8411573' />
      <link rel='edit' type='application/atom+xml'
        href='https://www.google.com/m8/feeds/contacts/example.com/full/8411573/1204224422303000' />
      <gd:phoneNumber rel='http://schemas.google.com/g/2005#other'
        primary='true'>456-123-2133</gd:phoneNumber>
      <gd:extendedProperty name="pet" value="hamster" />
      <gd:extendedProperty name="cuisine">
        <italian />
      </gd:extendedProperty>
      </entry>
      

Delete shared contacts

Deleted shared contacts can take up to 24 hours to disappear from the email address autocomplete and the contact manager. To update existing contacts, see Updating contacts. Don't update contacts by deleting contacts and then re-adding them.

  • To delete a shared contact, send a DELETE request to the contact's edit URL. This is the same URL used to update contacts.

Google retains placeholders for deleted contacts for 30 days after deletion. During that time, you can request the placeholders by using the showdeleted query parameter.

Next steps

Update or delete a photo for a shared contact