共享联系人元素
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Domain Shared Contacts API 使用标准 Google Data API 元素以及专门针对共享联系人使用的元素。
联系人条目采用扩展的联系人类型形式,表示个人、场所(例如俱乐部或餐厅)或组织。联系人类型在 XML 中显示为 <atom:entry>
元素,其中包含 Google 数据命名空间中的各种扩展元素。
指示条目为联系人的 category
元素如下所示:
<atom:category scheme="http://schemas.google.com/g/2005#kind"
term="http://schemas.google.com/contact/2008#contact"/>
在 Domain Shared Contacts API 中,有几个元素的限制性略高于联系人类型。对于以下元素,您可以提供 rel
属性或 label
属性,但不能同时提供这两个属性:
gd:email
gd:im
gd:organization
gd:phoneNumber
gd:structuredPostalAddress
创建或更新共享联系人时,如果您为任何这些元素同时提供 rel
和 label
,或者都不提供,则服务器会拒绝相应条目。
Google 相册支持
除了标准属性值(例如“self”或“edit”)之外,您还可以为 atom:link
元素使用 rel
值。使用照片链接时,必须在 HTTP 标头中指定授权令牌。如需了解详情,请参阅了解身份验证和授权。
rel="http://schemas.google.com/contacts/2008/rel#photo"
通过 GET
命令添加了读取与联系人关联的照片的功能。您可以使用 href
中指定的网址读取与联系人关联的最新版照片。如果联系人没有照片,系统不会显示链接。
示例:
<atom:link rel="http://schemas.google.com/contacts/2008/rel#photo"
href="https://www.google.com/m8/feeds/photos/media/jo%40example.com/1234" type="image/*" />
rel="http://schemas.google.com/contacts/2008/rel#edit-photo"
通过 PUT
或 DELETE
命令添加了更新或删除与联系人关联的本地照片的功能。
示例:
<atom:link rel="http://schemas.google.com/contacts/2008/rel#edit-photo"
href="https://www.google.com/m8/feeds/photos/media/jo%40example.com/1234/photo4524" />
gContact
的 XML 命名空间网址为 http://schemas.google.com/contact/2008
。
在此命名空间中,定义了一个元素来表示联系人所属的群组。
属性 |
说明 |
href |
标识联系人所属或曾所属的群组。该组通过其 ID 进行引用。 |
deleted="true" |
表示已移除联系人的群组成员资格。只有在将 showdeleted 指定为查询参数时,系统才会包含此属性;否则,系统不会返回联系人不再属于的群组的 groupMembershipInfo 。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-25。
[null,null,["最后更新时间 (UTC):2025-03-25。"],[],[],null,["# Shared contacts elements\n\nThe Domain Shared Contacts API uses the\n[standard Google Data API elements](https://developers.google.com/gdata/docs/2.0/elements)\nand elements that are specific for shared contacts.\n\nA contact entry takes the form of an extended\n[Contact kind](https://developers.google.com/gdata/docs/2.0/elements#gdContactKind),\nrepresenting a person, a venue---such as a club or a restaurant---or an\norganization. The contact kind appears in XML as an `\u003catom:entry\u003e` element that\ncontains various extension elements from the Google Data namespace.\n\nThe `category` element indicating that the entry is a contact looks like the\nfollowing: \n\n \u003catom:category scheme=\"http://schemas.google.com/g/2005#kind\"\n term=\"http://schemas.google.com/contact/2008#contact\"/\u003e\n\nIn the Domain Shared Contacts API, several elements are slightly more restrictive than\nthe contact kind. For the following elements, you supply either a `rel`\nattribute or a `label` attribute, but not both:\n\n- `gd:email`\n- `gd:im`\n- `gd:organization`\n- `gd:phoneNumber`\n- `gd:structuredPostalAddress`\n\nWhen you create or update a shared contact, if you supply both `rel` and\n`label`, or neither, for any of those elements, then the server rejects the\nentry.\n\nPhotos support\n--------------\n\nTogether with standard properties' values like self or edit, you can use `rel`\nvalues for `atom:link` elements. When using photo links, authorization token in\nthe HTTP header has to be specified. For more information, see\n[Learn about authentication and authorization](https://developers.google.com/workspace/guides/auth-overview).\n\n- With a `GET` command, `rel=\"http://schemas.google.com/contacts/2008/rel#photo\"` adds the capability of reading the photo associated with the contact. You can use the URL specified in `href` to read the latest version of the photo associated with the contact. The link isn't shown if there is no picture for the contact.\n\nExample: \n\n \u003catom:link rel=\"http://schemas.google.com/contacts/2008/rel#photo\"\n href=\"https://www.google.com/m8/feeds/photos/media/jo%40example.com/1234\" type=\"image/*\" /\u003e\n\n- With a `PUT` or `DELETE` command, `rel=\"http://schemas.google.com/contacts/2008/rel#edit-photo\"` adds the capability of updating or deleting a local photo that is associated with the contact.\n\nExample: \n\n \u003catom:link rel=\"http://schemas.google.com/contacts/2008/rel#edit-photo\"\n href=\"https://www.google.com/m8/feeds/photos/media/jo%40example.com/1234/photo4524\" /\u003e\n\n`gContact` namespace\n--------------------\n\nThe XML namespace URL for `gContact` is `http://schemas.google.com/contact/2008`.\n\nIn this namespace, an element is defined that represents a group to which the\ncontact belongs.\n\n### `gContact:groupMembershipInfo` properties\n\n| Property | Description |\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `href` | Identifies the group to which the contact belongs or belonged. The group is referenced by its ID. |\n| `deleted=\"true\"` | Means that the group membership was removed for the contact. This attribute is only included if `showdeleted` is specified as a query parameter, otherwise `groupMembershipInfo` for groups that a contact doesn't belong to anymore isn't returned. |"]]