โอนข้อมูล
หากต้องการใช้ 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"
]
}
]
}
]
}
API การโอนข้อมูลมีวิธีและทรัพยากรเพิ่มเติมที่จะช่วยคุณสร้างและดูแลการโอน ซึ่งช่วยให้คุณทำสิ่งต่างๆ ต่อไปนี้ได้
- แอปพลิเคชันลิสต์ที่ใช้โอนข้อมูลได้
- ดูข้อมูลการสมัครตามรหัสแอปพลิเคชัน
- การโอนรายการตามผู้ใช้ต้นทาง ผู้ใช้ปลายทาง หรือสถานะ
- รับคำขอโอน
ตามรหัสทรัพยากร
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2023-09-14 UTC
[null,null,["อัปเดตล่าสุด 2023-09-14 UTC"],[[["The Data Transfer API allows you to transfer data between users for specific applications, such as calendars, by defining a transfer and initiating it with the `insert` method."],["You need to define a `DataTransfer` resource which identifies the source and destination users, along with the applications and their parameters for data transfer."],["The process involves determining the applications, defining the transfer resource, and initiating the transfer using the `insert()` method."],["You can use the Data Transfer API to list available applications, retrieve application details, and manage transfer requests by listing or getting them based on user or status."]]],["Define a data transfer by specifying source and destination users and the applications involved. This is done by creating a `DataTransfer` resource. Initiate the transfer using the `insert()` method. Retrieve user IDs via the Directory API's `user.get()` method. Additional actions include listing applications, retrieving application information, listing transfers, and retrieving transfer requests. Application-specific parameters can be included. An example is provided of transferring a calendar.\n"]]