Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Domain Shared Contacts API cho phép các ứng dụng của bạn nhận và cập nhật danh bạ bên ngoài được chia sẻ với tất cả người dùng trong một miền Google Workspace. Tất cả người dùng của một miền Google Workspace và tất cả dịch vụ của Google đều có thể xem danh bạ dùng chung.
Ứng dụng của bạn có thể sử dụng Domain Shared Contacts API để tạo danh bạ được chia sẻ, chỉnh sửa hoặc xoá danh bạ được chia sẻ hiện có và truy vấn danh bạ được chia sẻ khớp với một tiêu chí cụ thể.
Chỉ tài khoản Google Workspace mới có thể sử dụng API Danh bạ dùng chung của miền.
Để sử dụng API này, hãy bật Domain Shared Contacts API trong Bảng điều khiển dành cho quản trị viên.
Các thay đổi đối với người liên hệ dùng chung có thể mất đến 24 giờ mới được phản ánh trong tính năng tự động hoàn thành địa chỉ email và trình quản lý liên hệ.
Ngoài việc cung cấp thông tin cơ bản về các tính năng của API Danh bạ dùng chung của miền, tài liệu này còn đưa ra các ví dụ về cách quản lý danh bạ bằng XML và HTTP. Sau khi đọc tài liệu này, bạn có thể tìm hiểu thêm về cách tương tác với API bằng cách sử dụng thư viện ứng dụng của chúng tôi.
Nếu bạn đang sử dụng hệ điều hành UNIX và muốn thử các ví dụ trong tài liệu này mà không cần viết mã, hãy sử dụng các tiện ích dòng lệnh UNIX curl hoặc wget.
Tìm hiểu cách sử dụng cURL với Dịch vụ dữ liệu của Google.
Nguyên tắc
Phiên bản này của API Danh bạ dùng chung của miền tuân theo các nguyên tắc của API Dữ liệu của Google.
API Dữ liệu của Google dựa trên cả định dạng phân phối Atom 1.0 và RSS 2.0, ngoài Giao thức phát hành Atom.
Chỉ định phiên bản
Mọi yêu cầu mà bạn gửi bằng Domain Shared Contacts API đều phải chỉ định phiên bản 3.0 của API:
GData-Version: 3.0
Nếu không thể đặt tiêu đề HTTP, bạn có thể chỉ định v=3.0 làm tham số truy vấn trong URL, nhưng bạn nên sử dụng phương thức tiêu đề HTTP.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-03-25 UTC."],[],[],null,["# Domain Shared Contacts API overview\n\nThe Domain Shared Contacts API lets your applications get and update external\ncontacts that are shared with all users in a Google Workspace domain. Shared\ncontacts are visible to all users of a Google Workspace domain and all Google\nservices have access to the contact list.\n| **Warning:** The Domain Shared Contacts API is intended only for *external* contacts. Using this API to create contact information for domain (internal) users or groups can result in duplicate contact information for those users and groups, which might lead to unexpected behavior. To get and update Google Workspace domain (internal) users' contact information, use the [Directory API](https://developers.google.com/workspace/admin/directory) instead.\n\nYour application can use the Domain Shared Contacts API to create shared contacts, edit\nor delete existing shared contacts, and query for shared contacts that match a\nparticular criteria.\n\nThe Domain Shared Contacts API is only available to Google Workspace accounts.\nTo use the API,\n[enable the Domain Shared Contacts API in the Admin console](https://support.google.com/a/answer/60757).\nShared contact changes can take up to 24 hours to be reflected in the email\naddress autocomplete and the contact manager.\n\nIn addition to providing background on the capabilities of the\nDomain Shared Contacts API, this document offers examples about how to manage\ncontacts by using XML and HTTP. After reading this document, you can learn more\nabout interacting with the API by using our\n[client libraries](https://developers.google.com/api-client-library).\n\nAudience\n--------\n\nThis document is intended for developers who want to write client applications\nthat can manipulate Google's contact lists by using HTTP and XML.\nThis document assumes that you understand the\n[fundamentals behind the Google Data APIs protocol](https://developers.google.com/gdata/docs/2.0/basics).\n\nIf you're using a UNIX operating system and you want to try the examples in this\ndocument without writing any code, use the UNIX command-line utilities\n[curl](https://curl.haxx.se/)\nor\n[wget](https://www.gnu.org/software/wget/).\nLearn how to\n[use cURL with Google Data services](https://developers.google.com/gdata/articles/using_cURL).\n\nPrinciples\n----------\n\nThis version of the Domain Shared Contacts API follows the principles of the\n[Google Data APIs](https://developers.google.com/gdata/docs/developers-guide).\nGoogle Data APIs are based on both the Atom 1.0 and RSS 2.0 syndication formats\nin addition to the Atom Publishing Protocol.\n\nSpecify a version\n-----------------\n\nEvery request that you send using the Domain Shared Contacts API should specify version\n3.0 of the API: \n\n GData-Version: 3.0\n\nIf you can't set HTTP headers, you can specify`v=3.0` as a query parameter in\nthe URL, but the HTTP header method is recommended.\n| **Note:** The client libraries supply appropriate version headers automatically, so don't use the `v=3.0` query parameter when you're using a client library."]]