当我将文件夹拖到另一个位置时,
有什么方法可以让我知道这个活动,告诉我它从哪里到哪里?
当我将文件夹拖到另一个位置时,
有什么方法可以让我知道这个活动,告诉我它从哪里到哪里?
使用Google Drive Activity API获取有关用户 Google Drive 中所做更改的信息。
itemName
根据您要使用此格式检查活动的文件/文件"items/FILE_ID"
夹设置"items/FOLDER_ID"
filter
为detail.action_detail_case:MOVE
获取移动操作活动参考:
{
"filter": "detail.action_detail_case:MOVE",
"itemName": "items/1BNPRFAJgVMW-DF_sdEsF-_14X0xxxxx"
}
move
ActionDetail的驱动器活动folder id: 1BNPRFAJgVMW-DF_sdEsF-_14X0xxxxx
这将返回一个DriveActivity对象,该对象将在ActionDetail对象下包含一个Move对象。您可以参考->获取有关文件/文件夹的先前父文件夹的信息和->获取文件/文件夹的新父文件夹removedParents
driveItem
addedParents
driveItem
{
"activities": [
{
"primaryActionDetail": {
"move": {
"addedParents": [
{
"driveItem": {
"name": "items/1mF5a3gxiLzVIRe2dhY4W3Alfxxxx",
"title": "NewFolder_Name",
"folder": {
"type": "STANDARD_FOLDER"
},
"driveFolder": {
"type": "STANDARD_FOLDER"
}
}
}
],
"removedParents": [
{
"driveItem": {
"name": "items/1lFzVvlBnBi-2o1VQGF5JDFRxxxxx",
"title": "TESTFOLDER",
"folder": {
"type": "STANDARD_FOLDER"
},
"driveFolder": {
"type": "STANDARD_FOLDER"
}
}
}
]
}
},
.....
"targets": [
{
"driveItem": {
"name": "items/11TrX6KcAJppWCj9GSUjSYn79Aqxxxx",
"title": "CSVFOLDER",
"folder": {
"type": "STANDARD_FOLDER"
},
"mimeType": "application/vnd.google-apps.folder",
.......
}
}
],
"timestamp": "2021-08-12T16:10:24.744Z"
}
]
}