Przenoszenie danych
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Aby korzystać z interfejsu Data Transfer API, zdefiniuj transfer, a następnie zainicjuj go za pomocą metody insert
. Przeniesienie jest zdefiniowane w terminach co najmniej 1 aplikacji, której dane zostaną przeniesione, i może obejmować parametry specyficzne dla aplikacji.
Oto ogólny opis procesu przenoszenia:
- Określ aplikacje, z których chcesz przenieść dane.
- Zdefiniuj zasób
DataTransfer
, który określa źródłowe i docelowe konta użytkowników oraz aplikacje, do których mają zostać przeniesione dane.
- Rozpocznij przenoszenie za pomocą metody
insert()
.
Na przykład w tym ciele żądania JSON kalendarz jest przenoszony od użytkownika źródłowego (SOURCE_USER_ID
) do użytkownika docelowego (DESTINATION_USER_ID
). Identyfikatory użytkowników możesz pobrać, wywołując metodęuser.get()
interfejsu Directory API i podając adres e-mail lub alias e-mail.
{
"oldOwnerUserId": "SOURCE_USER_ID",
"newOwnerUserId": "DESTINATION_USER_ID",
"applicationDataTransfers": [
{
"applicationId": "435070579839",
"applicationTransferParams": [
{
"key": "RELEASE_RESOURCES",
"value": [
"TRUE"
]
}
]
}
]
}
Interfejs Data Transfer API zawiera dodatkowe metody i zasoby, które ułatwiają tworzenie i zarządzanie transferami. Możesz dzięki nim wykonywać takie czynności jak:
- Listaaplikacji dostępnych do przenoszenia danych.
- Pobierz informacje o aplikacji według identyfikatora aplikacji.
- Lista przenoszonych użytkowników według użytkownika źródłowego, użytkownika docelowego lub stanu.
- Pobierz prośbę o przeniesienie zasobu według identyfikatora zasobu.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-03-25 UTC.
[null,null,["Ostatnia aktualizacja: 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."]]