Chuyển dữ liệu
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.
Để sử dụng API Chuyển dữ liệu, bạn xác định một lượt chuyển rồi bắt đầu lượt chuyển đó bằng phương thức insert
. Quá trình chuyển được xác định theo một hoặc nhiều ứng dụng có dữ liệu sẽ được chuyển và có thể bao gồm các tham số dành riêng cho ứng dụng.
Sau đây là thông tin tóm tắt cấp cao về quy trình chuyển:
- Xác định những ứng dụng mà bạn muốn chuyển dữ liệu.
- Xác định một tài nguyên
DataTransfer
chỉ định người dùng nguồn và đích cũng như các ứng dụng để chuyển dữ liệu.
- Bắt đầu quá trình chuyển bằng cách sử dụng phương thức
insert()
.
Ví dụ: nội dung yêu cầu JSON sau đây sẽ chuyển một lịch từ người dùng nguồn (SOURCE_USER_ID
) sang người dùng đích (DESTINATION_USER_ID
). Bạn có thể truy xuất mã nhận dạng người dùng cho từng chủ sở hữu bằng cách gọi phương thức user.get()
của Directory API và cung cấp địa chỉ email hoặc bí danh email của họ.
{
"oldOwnerUserId": "SOURCE_USER_ID",
"newOwnerUserId": "DESTINATION_USER_ID",
"applicationDataTransfers": [
{
"applicationId": "435070579839",
"applicationTransferParams": [
{
"key": "RELEASE_RESOURCES",
"value": [
"TRUE"
]
}
]
}
]
}
Data Transfer API bao gồm các phương thức và tài nguyên bổ sung để giúp bạn tạo và quản lý các lượt chuyển, cho phép bạn thực hiện các thao tác như sau:
- Liệt kê các ứng dụng có thể chuyển dữ liệu.
- Tải thông tin ứng dụng theo mã ứng dụng.
- Danh sách các lượt chuyển theo người dùng nguồn, người dùng đích hoặc trạng thái.
- Nhận yêu cầu chuyển theo mã nhận dạng tài nguyên.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-03-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-03-25 UTC."],[],[],null,["# Transfer data\n\nTo use the Data Transfer API, you define a transfer and then initiate\nit using the `insert` method. The transfer is defined in terms of one or more\napplications whose data will be transferred, and can include\n[application-specific parameters](/workspace/admin/data-transfer/v1/parameters).\n\nThe following is a high-level summary of the transfer process:\n\n1. Determine the applications for which you want to transfer data.\n2. Define a [`DataTransfer` resource](/workspace/admin/data-transfer/reference/rest/v1/transfers) that specifies the source and destination users and the applications for which to transfer data.\n3. Initiate the transfer by using the [`insert()` method](/workspace/admin/data-transfer/reference/rest/v1/transfers/insert).\n\nFor example, the following JSON request body transfers a calendar from\nthe source user (\u003cvar translate=\"no\"\u003eSOURCE_USER_ID\u003c/var\u003e) to the destination user\n(\u003cvar translate=\"no\"\u003eDESTINATION_USER_ID\u003c/var\u003e). You can retrieve the user IDs for\neach owner by calling the\n[`user.get()` method](/workspace/admin/directory/reference/rest/v1/users/get)\nof the Directory API and providing their email address or email alias. \n\n {\n \"oldOwnerUserId\": \"\u003cvar translate=\"no\"\u003eSOURCE_USER_ID\u003c/var\u003e\",\n \"newOwnerUserId\": \"\u003cvar translate=\"no\"\u003eDESTINATION_USER_ID\u003c/var\u003e\",\n \"applicationDataTransfers\": [\n {\n \"applicationId\": \"435070579839\",\n \"applicationTransferParams\": [\n {\n \"key\": \"RELEASE_RESOURCES\",\n \"value\": [\n \"TRUE\"\n ]\n }\n ]\n }\n ]\n }\n\nRelated topics\n--------------\n\nThe Data Transfer API includes additional methods and resources to\nhelp you construct and administer transfers, allowing you to do things like\nthe following:\n\n- [List](/workspace/admin/data-transfer/v1/reference/applications/list) applications available for data transfer.\n- [Get](/workspace/admin/data-transfer/v1/reference/applications/get) application information by application ID.\n- [List](/workspace/admin/data-transfer/v1/reference/transfers/list) transfers by source user, destination user, or status.\n- [Get](/workspace/admin/data-transfer/v1/reference/transfers/get) a transfer request by resource ID."]]