העברת נתונים
כדי להשתמש ב-Data Transfer API, צריך להגדיר העברה ולהתחיל אותה בשיטה insert
. ההעברה מוגדרת לפי אפליקציה אחת או יותר שהנתונים שלהן יועברו, והיא יכולה לכלול פרמטרים ספציפיים לאפליקציה.
לפניכם סיכום כללי של תהליך ההעברה:
- בוחרים את האפליקציות שעבורן רוצים להעביר נתונים.
- מגדירים משאב
DataTransfer
שמציין את המשתמשים במקור וביעד ואת האפליקציות שאליהן יועברו הנתונים.
- מתחילים את ההעברה באמצעות השיטה
insert()
.
לדוגמה, גוף בקשת ה-JSON הבא מעביר יומן ממשתמש המקור (SOURCE_USER_ID
) למשתמש היעד (DESTINATION_USER_ID
). אפשר לאחזר את מזהי המשתמשים של כל בעלים באמצעות קריאה ל-method user.get()
של ה-Directory API וציון כתובת האימייל או כתובת האימייל החלופית שלו.
{
"oldOwnerUserId": "SOURCE_USER_ID",
"newOwnerUserId": "DESTINATION_USER_ID",
"applicationDataTransfers": [
{
"applicationId": "435070579839",
"applicationTransferParams": [
{
"key": "RELEASE_RESOURCES",
"value": [
"TRUE"
]
}
]
}
]
}
ב-Data Transfer API יש שיטות ומשאבים נוספים שיעזרו לכם ליצור ולנהל את ההעברות, וכך לבצע פעולות כמו:
- רשימה של האפליקציות הזמינות להעברת נתונים.
- קבלת פרטי האפליקציה לפי מזהה האפליקציה.
- רשימה של העברות לפי משתמש המקור, משתמש היעד או הסטטוס.
- מקבלים בקשת העברה לפי מזהה המשאב.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 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"]]