更新或刪除共用聯絡人
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
更新或刪除共用聯絡人的程序類似。
更新項目時,您必須保留從伺服器擷取項目時出現的「所有」 XML。否則系統會刪除忽略的元素。更新作業最多可能需要 24 小時才會在電子郵件地址自動完成功能和聯絡人管理工具中生效。
如要更新現有的共用聯絡人,請按照下列步驟操作:
- 取得要更新的項目。
- 編輯項目。
傳送 PUT
要求,並在訊息主體中加入更新的項目,傳送至聯絡人的編輯網址。請使用 application/atom+xml
內容類型,並確認更新項目中的 <id>
值與現有項目的 <id>
完全一致。編輯網址結尾會加上版本號碼,以便偵測不同來源的更新內容是否有衝突。詳情請參閱版本管理。
更新項目:
<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>
更改下列內容:
刪除的共用聯絡人資料最多可能要經過 24 小時才會從電子郵件地址自動完成功能和聯絡人管理工具中消失。如要更新現有聯絡人,請參閱「更新聯絡人」。請勿刪除聯絡人再重新加入,以免造成聯絡人資料更新失敗。
- 如要刪除共用聯絡人,請將
DELETE
要求傳送至聯絡人的編輯網址。這個網址與更新聯絡人時使用的網址相同。
Google 會在刪除聯絡人後的 30 天內保留聯絡人的預留位置。在此期間,您可以使用 showdeleted
查詢參數要求預留位置。
後續步驟
更新或刪除共用聯絡人的相片
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-03-25 (世界標準時間)。
[null,null,["上次更新時間:2025-03-25 (世界標準時間)。"],[],[],null,["# Update or delete a shared contact\n\nThe processes to update or delete a shared contact are similar.\n\nUpdate a shared contact\n-----------------------\n\nWhen you update an entry, you must preserve *all* the XML that was present when\nyou retrieved the entry from the server. Otherwise the ignored elements are\ndeleted. Updates can take up to 24 hours to be reflected in the email address\nauto-complete and the contact manager.\n\nTo update an existing shared contact, do the following:\n\n1. [Get the entry that you want to update](/workspace/admin/domain-shared-contacts/get-shared-contacts).\n2. Edit the entry.\n3. Send a `PUT` request with the updated entry in the message body to the\n contact's edit URL. Use the `application/atom+xml` content type and make\n sure that the `\u003cid\u003e` value in the updated entry exactly matches the `\u003cid\u003e`\n of the existing entry. The edit URL ends with a version number, in order to\n detect conflicts of updates from different sources. For more information,\n see\n [versioning](https://developers.google.com/gdata/docs/1.0/reference#Optimistic-concurrency).\n\n Update the entry: \n\n ```xml\n \u003centry\u003e\n \u003cid\u003ehttps://www.google.com/m8/feeds/contacts/DOMAIN/base/8411573\u003c/id\u003e\n \u003cupdated\u003e2008-02-28T18:47:02.303Z\u003c/updated\u003e\n \u003ccategory scheme='http://schemas.google.com/g/2005#kind'\n term='http://schemas.google.com/contact/2008#contact' /\u003e\n \u003ctitle type='text'\u003eTITLE_NAME\u003c/title\u003e\n \u003cgd:name\u003e\n \u003cgd:fullName\u003eFIRST_NAME LAST_NAME\u003c/gd:fullName\u003e\n \u003c/gd:name\u003e\n \u003ccontent type='text'\u003eNOTES\u003c/content\u003e\n \u003clink rel='self' type='application/atom+xml'\n href='https://www.google.com/m8/feeds/contacts/DOMAIN/PROJECTION/8411573' /\u003e\n \u003clink rel='edit' type='application/atom+xml'\n href='https://www.google.com/m8/feeds/contacts/DOMAIN/PROJECTION/8411573/1204224422303000' /\u003e\n \u003cgd:phoneNumber rel='http://schemas.google.com/g/2005#other'\n primary='true'\u003ePRIMARY_PHONE_NUMBER\u003c/gd:phoneNumber\u003e\n \u003cgd:extendedProperty name=\"CUSTOM_PROPERTY\" value=\"CUSTOM_PROPRTY_VALUE\" /\u003e\n \u003c/entry\u003e\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eDOMAIN\u003c/var\u003e: The URL for your domain---for example, example.com.\n - \u003cvar translate=\"no\"\u003eTITLE_NAME\u003c/var\u003e: A name for the contact entry---for example, example.com contact list.\n - \u003cvar translate=\"no\"\u003eFIRST_NAME\u003c/var\u003e: The first name of the shared contact---for example, Alex.\n - \u003cvar translate=\"no\"\u003eLAST_NAME\u003c/var\u003e: The last name of the shared contact---for example, Kim.\n - \u003cvar translate=\"no\"\u003ePROJECTION\u003c/var\u003e: The projection value that specifies the `gd:extendedProperty` elements. For a list of supported values, see [Projection values](/workspace/admin/domain-shared-contacts/extended-properties-projections#projection_values).\n - \u003cvar translate=\"no\"\u003ePRIMARY_PHONE_NUMBER\u003c/var\u003e: The preferred phone number for the shared contact---for example, (206)555-1212.\n - \u003cvar translate=\"no\"\u003eCUSTOM_PROPERTY\u003c/var\u003e: A name for a custom property that you want to store about the shared contact---for example, pet.\n - \u003cvar translate=\"no\"\u003eCUSTOM_PROPRTY_VALUE\u003c/var\u003e: A value for a custom\n property that you want to store about the shared contact---for example,\n hamster.\n\n The following is an example of an updated entry for a shared contact with\n the edit URL highlighted: \n\n ```xml\n \u003centry\u003e\n \u003cid\u003ehttps://www.google.com/m8/feeds/contacts/example.com/base/8411573\u003c/id\u003e\n \u003cupdated\u003e2008-02-28T18:47:02.303Z\u003c/updated\u003e\n \u003ccategory scheme='http://schemas.google.com/g/2005#kind'\n term='http://schemas.google.com/contact/2008#contact' /\u003e\n \u003ctitle type='text'\u003eFitzgerald\u003c/title\u003e\n \u003cgd:name\u003e\n \u003cgd:fullName\u003eFitzgerald\u003c/gd:fullName\u003e\n \u003c/gd:name\u003e\n \u003ccontent type='text'\u003eNotes\u003c/content\u003e\n \u003clink rel='self' type='application/atom+xml'\n href='https://www.google.com/m8/feeds/contacts/example.com/full/8411573' /\u003e\n \u003clink rel='edit' type='application/atom+xml'\n href='https://www.google.com/m8/feeds/contacts/example.com/full/8411573/1204224422303000' /\u003e\n \u003cgd:phoneNumber rel='http://schemas.google.com/g/2005#other'\n primary='true'\u003e456-123-2133\u003c/gd:phoneNumber\u003e\n \u003cgd:extendedProperty name=\"pet\" value=\"hamster\" /\u003e\n \u003cgd:extendedProperty name=\"cuisine\"\u003e\n \u003citalian /\u003e\n \u003c/gd:extendedProperty\u003e\n \u003c/entry\u003e\n ```\n\nDelete shared contacts\n----------------------\n\nDeleted shared contacts can take up to 24 hours to disappear from the email\naddress autocomplete and the contact manager. To update existing contacts, see\n[Updating contacts](#update_a_shared_contact).\nDon't update contacts by deleting contacts and then re-adding them.\n\n- To delete a shared contact, send a `DELETE` request to the contact's edit URL. This is the same URL used to [update contacts](#update_a_shared_contact).\n\nGoogle retains placeholders for deleted contacts for 30 days after deletion.\nDuring that time, you can request the placeholders by using the `showdeleted`\nquery parameter.\n\nNext steps\n----------\n\n[Update or delete a photo for a shared contact](/workspace/admin/domain-shared-contacts/update-delete-photo-shared-contacts)"]]