โอนข้อมูล
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
หากต้องการใช้ Data Transfer API คุณต้องกำหนดการโอน แล้วเริ่มการโอนโดยใช้เมธอด insert
การโอนจะกำหนดในแง่ของแอปพลิเคชันอย่างน้อย 1 รายการที่จะโอนข้อมูล และอาจมีพารามิเตอร์เฉพาะแอปพลิเคชัน
ต่อไปนี้เป็นภาพรวมระดับสูงของกระบวนการโอน
- ระบุแอปพลิเคชันที่คุณต้องการโอนข้อมูล
- กําหนดทรัพยากร
DataTransfer
ที่ระบุผู้ใช้ต้นทางและปลายทาง รวมถึงแอปพลิเคชันที่จะโอนข้อมูล
- เริ่มการโอนโดยใช้
insert()
ตัวอย่างเช่น เนื้อหาคำขอ JSON ต่อไปนี้จะโอนปฏิทินจากผู้ใช้ต้นทาง (SOURCE_USER_ID
) ไปยังผู้ใช้ปลายทาง (DESTINATION_USER_ID
) คุณสามารถเรียกดูรหัสผู้ใช้สำหรับเจ้าของแต่ละรายได้โดยเรียกใช้เมธอด user.get()
ของ Directory API และระบุอีเมลหรืออีเมลแทน
{
"oldOwnerUserId": "SOURCE_USER_ID",
"newOwnerUserId": "DESTINATION_USER_ID",
"applicationDataTransfers": [
{
"applicationId": "435070579839",
"applicationTransferParams": [
{
"key": "RELEASE_RESOURCES",
"value": [
"TRUE"
]
}
]
}
]
}
Data Transfer API มีวิธีการและแหล่งข้อมูลเพิ่มเติมเพื่อช่วยในการสร้างและจัดการการโอน ซึ่งจะช่วยให้คุณทําสิ่งต่อไปนี้ได้
- แสดงรายการแอปพลิเคชันที่ใช้โอนข้อมูลได้
- ดูข้อมูลแอปพลิเคชันตามรหัสแอปพลิเคชัน
- แสดงรายการการโอนตามผู้ใช้ต้นทาง ผู้ใช้ปลายทาง หรือสถานะ
- ดูคำขอโอนตามรหัสทรัพยากร
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-03-25 UTC
[null,null,["อัปเดตล่าสุด 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."]]