轉移資料
如要使用 Data Transfer API,請定義移轉作業,然後使用 insert
方法啟動移轉作業。移轉作業是以一或多個資料移轉的應用程式為基礎,可能包含應用程式專屬參數。
以下是轉移程序的概要摘要:
- 決定您要轉移資料的應用程式。
- 定義
DataTransfer
資源,以指定來源和目標使用者,以及要轉移資料的應用程式。
- 請使用
insert()
方法啟動轉移作業。
舉例來說,下列 JSON 要求主體會將日曆從來源使用者 (SOURCE_USER_ID
) 轉移至目標使用者 (DESTINATION_USER_ID
)。如要擷取每位擁有者的使用者 ID,您可以呼叫 Directory API 的 user.get()
方法,並提供其電子郵件地址或電子郵件別名。
{
"oldOwnerUserId": "SOURCE_USER_ID",
"newOwnerUserId": "DESTINATION_USER_ID",
"applicationDataTransfers": [
{
"applicationId": "435070579839",
"applicationTransferParams": [
{
"key": "RELEASE_RESOURCES",
"value": [
"TRUE"
]
}
]
}
]
}
Data Transfer API 提供額外的方法和資源,可協助您建構及管理移轉作業,並執行下列操作:
- List 應用程式可用於轉移資料。
- 依據應用程式 ID 取得應用程式資訊。
- 按照來源使用者、目標使用者或狀態進行清單轉移。
- 依據資源 ID 取得移轉要求。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2023-09-14 (世界標準時間)。
[null,null,["上次更新時間:2023-09-14 (世界標準時間)。"],[[["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."]]],[]]