Freigegebene Kontakte erstellen
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Nachdem Sie die Authentifizierung eingerichtet haben, können Sie mit der Domain Shared Contacts API neue freigegebene Kontaktdateneinträge in einer Google Workspace-Domain veröffentlichen. Es kann bis zu 24 Stunden dauern, bis freigegebene Kontakte in der automatischen Vervollständigung von E-Mail-Adressen und im Kontaktmanager angezeigt werden.
Erstellen Sie eine XML-Darstellung des freigegebenen Kontakts, den Sie veröffentlichen möchten, in Form eines Atom-<entry>
-Elements vom Kontakttyp. Das Element könnte in etwa so aussehen:
<atom:entry xmlns:atom='http://www.w3.org/2005/Atom'
xmlns:gd='http://schemas.google.com/g/2005'>
<atom:category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/contact/2008#contact' />
<gd:name>
<gd:givenName>FIRST_NAME</gd:givenName>
<gd:familyName>LAST_NAME</gd:familyName>
<gd:fullName>FIRST_NAME LAST_NAME</gd:fullName>
</gd:name>
<atom:content type='text'>NOTES</atom:content>
<gd:email rel='http://schemas.google.com/g/2005#work'
primary='true'
address='PRIMARY_EMAIL_ADDRESS' displayName='PREFERRED_NAME' />
<gd:email rel='http://schemas.google.com/g/2005#home'
address='SECONDARY_EMAIL_ADDRESS' />
<gd:phoneNumber rel='http://schemas.google.com/g/2005#work'
primary='true'>
PRIMARY_PHONE_NUMBER
</gd:phoneNumber>
<gd:phoneNumber rel='http://schemas.google.com/g/2005#home'>
SECONDARY_PHONE_NUMBER
</gd:phoneNumber>
<gd:im address='INSTANT_MESSAGING_ADDRESS'
protocol='http://schemas.google.com/g/2005#GOOGLE_TALK'
primary='true'
rel='http://schemas.google.com/g/2005#home' />
<gd:structuredPostalAddress
rel='http://schemas.google.com/g/2005#work'
primary='true'>
<gd:city>CITY_NAME</gd:city>
<gd:street>ADDRESS</gd:street>
<gd:region>REGION_NAME</gd:region>
<gd:postcode>POST_CODE</gd:postcode>
<gd:country>COUNTRY_NAME</gd:country>
<gd:formattedAddress>
FORMATTED_ADDRESS
</gd:formattedAddress>
</gd:structuredPostalAddress>
</atom:entry>
Ersetzen Sie Folgendes:
FIRST_NAME
: Vorname des geteilten Kontakts, z. B. Alex.
LAST_NAME
: Der Nachname des freigegebenen Kontakts, z. B. Müller.
PRIMARY_EMAIL_ADDRESS
: Die bevorzugte E-Mail-Adresse des freigegebenen Kontakts, z. B. alk@gmail.com.
PREFERRED_NAME
: Der Name, der für den Nutzer angezeigt wird, z. B. Alex Kim
SECONDARY_EMAIL_ADDRESS
: Eine weitere E-Mail-Adresse für den freigegebenen Kontakt, z. B. alk@beispiel.de.
PRIMARY_PHONE_NUMBER
: Die bevorzugte Telefonnummer für den freigegebenen Kontakt, z. B. +1-800-555-0100.
SECONDARY_PHONE_NUMBER
: Eine weitere Telefonnummer für den freigegebenen Kontakt, z. B. (800) 555-0101.
INSTANT_MESSAGING_ADDRESS
: Die E-Mail-Adresse, die mit den Instant-Messaging-Informationen des freigegebenen Kontakts verknüpft ist, z. B. alk@gmail.com.
CITY_NAME
: Der Name der Stadt für den freigegebenen Kontakt, z. B. Mountain View.
ADDRESS
: Die Adresse des freigegebenen Kontakts, z. B. 1600 Amphibious Blvd.
REGION_NAME
: Das Bundesland oder die Provinz des freigegebenen Kontakts, z. B. CA.
POST_CODE
: Die Postleitzahl des freigegebenen Kontakts, z. B. 94045.
COUNTRY_NAME
: Das Land des freigegebenen Kontakts, z. B. Deutschland.
FORMATTED_ADDRESS
: Die Adresse des freigegebenen Kontakts, die gemäß den Konventionen des jeweiligen Landes oder der jeweiligen Region formatiert ist, z. B. 1800 Amphibious Blvd Mountain View.
Wenn Sie diesen Eintrag veröffentlichen möchten, senden Sie ihn an die Feed-URL der Kontaktliste:
- Platziere dein Atom-
<entry>
-Element im Textkörper einer neuen POST
-Anfrage und verwende dabei den Inhaltstyp application/atom+xml
.
- Senden Sie die
POST
-Anfrage an die Feed-URL.
Wenn Sie beispielsweise der Liste für beispiel.de einen domaingemeinsamen Kontakt hinzufügen möchten, senden Sie die POST
-Anfrage mit dem neuen Eintrag an die folgende URL:
https://www.google.com/m8/feeds/contacts/example.com/full
Der Google-Server erstellt einen Kontakt anhand des von Ihnen gesendeten Eintrags und gibt dann einen HTTP 201 CREATED
-Statuscode sowie eine Kopie des neuen Kontakts in Form eines <entry>
-Elements zurück. Der zurückgegebene Eintrag ist mit dem von dir gesendeten identisch, enthält aber auch verschiedene Elemente, die vom Server hinzugefügt wurden, z. B. ein <id>
-Element.
Wenn Ihre Anfrage fehlschlägt, gibt Google möglicherweise einen anderen Statuscode zurück. Informationen zu den Statuscodes finden Sie im Referenzdokument zum Google Data API-Protokoll.
Nächste Schritte
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-03-25 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-03-25 (UTC)."],[],[],null,["# Create shared contacts\n\nAfter\n[setting up authentication](https://developers.google.com/workspace/guides/auth-overview),\nyou can use the Domain Shared Contacts API to publish new shared contact entries to a\nGoogle Workspace domain. Shared contacts can take up to 24 hours to\nappear in the email address autocomplete and the contact manager.\n\n1. Create an XML representation of the shared contact that you want to\n publish in the form of an Atom `\u003centry\u003e` element of the\n [Contact kind](https://developers.google.com/gdata/docs/2.0/elements#gdContactKind),\n which might look similar to the following:\n\n ```xml\n \u003catom:entry xmlns:atom='http://www.w3.org/2005/Atom'\n xmlns:gd='http://schemas.google.com/g/2005'\u003e\n \u003catom:category scheme='http://schemas.google.com/g/2005#kind'\n term='http://schemas.google.com/contact/2008#contact' /\u003e\n \u003cgd:name\u003e\n \u003cgd:givenName\u003eFIRST_NAME\u003c/gd:givenName\u003e\n \u003cgd:familyName\u003eLAST_NAME\u003c/gd:familyName\u003e\n \u003cgd:fullName\u003eFIRST_NAME LAST_NAME\u003c/gd:fullName\u003e\n \u003c/gd:name\u003e\n \u003catom:content type='text'\u003eNOTES\u003c/atom:content\u003e\n \u003cgd:email rel='http://schemas.google.com/g/2005#work'\n primary='true'\n address='PRIMARY_EMAIL_ADDRESS' displayName='PREFERRED_NAME' /\u003e\n \u003cgd:email rel='http://schemas.google.com/g/2005#home'\n address='SECONDARY_EMAIL_ADDRESS' /\u003e\n \u003cgd:phoneNumber rel='http://schemas.google.com/g/2005#work'\n primary='true'\u003e\n PRIMARY_PHONE_NUMBER\n \u003c/gd:phoneNumber\u003e\n \u003cgd:phoneNumber rel='http://schemas.google.com/g/2005#home'\u003e\n SECONDARY_PHONE_NUMBER\n \u003c/gd:phoneNumber\u003e\n \u003cgd:im address='INSTANT_MESSAGING_ADDRESS'\n protocol='http://schemas.google.com/g/2005#GOOGLE_TALK'\n primary='true'\n rel='http://schemas.google.com/g/2005#home' /\u003e\n \u003cgd:structuredPostalAddress\n rel='http://schemas.google.com/g/2005#work'\n primary='true'\u003e\n \u003cgd:city\u003eCITY_NAME\u003c/gd:city\u003e\n \u003cgd:street\u003eADDRESS\u003c/gd:street\u003e\n \u003cgd:region\u003eREGION_NAME\u003c/gd:region\u003e\n \u003cgd:postcode\u003ePOST_CODE\u003c/gd:postcode\u003e\n \u003cgd:country\u003eCOUNTRY_NAME\u003c/gd:country\u003e\n \u003cgd:formattedAddress\u003e\n FORMATTED_ADDRESS\n \u003c/gd:formattedAddress\u003e\n \u003c/gd:structuredPostalAddress\u003e\n \u003c/atom:entry\u003e\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eFIRST_NAME\u003c/var\u003e: 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\"\u003ePRIMARY_EMAIL_ADDRESS\u003c/var\u003e: The preferred email address of the shared contact---for example, alk@gmail.com.\n - \u003cvar translate=\"no\"\u003ePREFERRED_NAME\u003c/var\u003e: The name that is displayed for the user---for example, Alex Kim\n - \u003cvar translate=\"no\"\u003eSECONDARY_EMAIL_ADDRESS\u003c/var\u003e: Another email address for the shared contact---for example, alk@example.org.\n - \u003cvar translate=\"no\"\u003ePRIMARY_PHONE_NUMBER\u003c/var\u003e: The preferred phone number for the shared contact---for example, (800) 555-0100.\n - \u003cvar translate=\"no\"\u003eSECONDARY_PHONE_NUMBER\u003c/var\u003e: Another phone number for the shared contact---for example, (800) 555-0101.\n - \u003cvar translate=\"no\"\u003eINSTANT_MESSAGING_ADDRESS\u003c/var\u003e: The email address associated with the shared contact's instant messaging information---for example, alk@gmail.com.\n - \u003cvar translate=\"no\"\u003eCITY_NAME\u003c/var\u003e: The city name for the shared contact---for example, Mountain View.\n - \u003cvar translate=\"no\"\u003eADDRESS\u003c/var\u003e: The street address for the shared contact---for example, 1600 Amphibious Blvd.\n - \u003cvar translate=\"no\"\u003eREGION_NAME\u003c/var\u003e: The state or province for the shared contact---for example, CA.\n - \u003cvar translate=\"no\"\u003ePOST_CODE\u003c/var\u003e: The ZIP or postal code for the shared contact---for example, 94045.\n - \u003cvar translate=\"no\"\u003eCOUNTRY_NAME\u003c/var\u003e: The country for the shared contact---for example, United States.\n - \u003cvar translate=\"no\"\u003eFORMATTED_ADDRESS\u003c/var\u003e: The address of the shared contact that is formatted using the convention of their country or region---for example,1800 Amphibious Blvd Mountain View.\n2. To publish this entry, send it to the contact-list feed URL:\n\n 1. Place your Atom `\u003centry\u003e` element in the body of a new `POST` request by using the `application/atom+xml` content type.\n 2. Send the `POST` request to the feed URL.\n\n For example, to add a domain shared contact to the list belonging to\n example.com, send the `POST` request with the new entry to the following\n URL: \n\n https://www.google.com/m8/feeds/contacts/example.com/full\n\n The Google server creates a contact by using the entry that you sent, then\n returns an `HTTP 201 CREATED` status code, along with a copy of the new\n contact in the form of an `\u003centry\u003e` element. The entry returned is the same\n one that you sent, but it also contains various elements added by the\n server, such as an `\u003cid\u003e` element.\n\n If your request fails, Google might return a different\n status code. For information about the status codes, see the\n [Google Data API protocol reference document](https://developers.google.com/gdata/docs/2.0/reference).\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)"]]