转移数据
如需使用 Data Transfer API,请定义一项传输,然后使用 insert
方法启动该传输。传输是根据其数据的一个或多个应用来定义的,并可以包含应用特定的参数。
下面简要介绍了转移流程:
- 确定要为哪些应用转移数据。
- 定义一个
DataTransfer
资源,用于指定源用户和目标用户以及要为哪些应用传输数据。
- 使用
insert()
方法启动转移。
例如,以下 JSON 请求正文将日历从源用户 (SOURCE_USER_ID
) 转移到目标用户 (DESTINATION_USER_ID
)。您可以通过调用 Directory API 的 user.get()
方法并提供他们的电子邮件地址或电子邮件别名来检索每个所有者的用户 ID。
{
"oldOwnerUserId": "SOURCE_USER_ID",
"newOwnerUserId": "DESTINATION_USER_ID",
"applicationDataTransfers": [
{
"applicationId": "435070579839",
"applicationTransferParams": [
{
"key": "RELEASE_RESOURCES",
"value": [
"TRUE"
]
}
]
}
]
}
Data Transfer API 包含其他方法和资源,可帮助您构建和管理转移作业,并让您能够执行以下操作:
- 列出可用于数据传输的应用。
- 按应用 ID 获取应用信息。
- List 方法,按源用户、目标用户或状态进行传输。
- 按资源 ID 获取转移请求。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-09-14。
[null,null,["最后更新时间 (UTC):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."]]],[]]