Попытка удалить [1] общий диск.Запрос возвращается с 403 Forbidden и следующим телом:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "cannotDeleteResourceWithChildren",
"message": "This resource cannot be deleted because it has children."
}
],
"code": 403,
"message": "This resource cannot be deleted because it has children."
}
}
Диск, однако, пуст.Непосредственный предыдущий запрос списка возвратил пустой список.
Повторная отправка того же запроса на удаление через несколько секунд.
Редактировать: забыли упомянуть, что файл был удален (отправлен в корзину) простоперед запросом списка.
Шаги для воспроизведения:
- отправка файла с общего диска в корзину;
- запрос списка.Возвращает пустой список;
- удалить запрос на общий диск
[1] https://developers.google.com/drive/api/v3/reference/drives/delete
[2] https://developers.google.com/drive/api/v3/reference/files/list
Редактировать: Я могу воспроизвести эту проблему с помощью cURL.Записи cURL были созданы с помощью функции Копировать как cURL из Chrome.Смотрите ниже скрипт bash с последующим выводом.Это общий диск с 10 файлами.
DRIVEID=0ANMOBifriUr9Uk9PVA
curl "https://content.googleapis.com/drive/v3/files?corpora=drive&driveId=$DRIVEID&includeItemsFromAllDrives=true&q=trashed%3Dfalse&supportsAllDrives=true&fields=files(id%2Cname)" -H 'sec-fetch-mode: cors' -H 'x-goog-encode-response-if-executable: base64' -H 'accept-encoding: gzip, deflate, br' -H 'x-origin: https://explorer.apis.google.com' -H 'accept-language: en-US,en;q=0.9' -H 'authorization: Bearer AuthToken0' -H 'x-requested-with: XMLHttpRequest' -H 'x-clientdetails: appVersion=5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1&platform=Win32&userAgent=Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1' -H 'x-javascript-user-agent: apix/3.0.0 google-api-javascript-client/1.1.0' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3829.0 Safari/537.36 Edg/77.0.197.1' -H 'accept: */*' -H 'referer: https://content.googleapis.com/static/proxy.html?usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.pt_BR.9VS-OXqJJxY.O%2Fam%3DwQE%2Fd%3D1%2Frs%3DAGLTcCOat2vY5WjTVOTl0GbC_09htXr7UQ%2Fm%3D__features__' -H 'authority: content.googleapis.com' -H 'sec-fetch-site: same-origin' -H 'x-referer: https://explorer.apis.google.com' --compressed
curl 'https://content.googleapis.com/drive/v3/files/1fkLANZMuX7Tl_6rTQgqFV6x2St48UcVo?supportsAllDrives=true&alt=json' -X PATCH -H 'sec-fetch-mode: cors' -H 'x-goog-encode-response-if-executable: base64' -H 'accept-encoding: gzip, deflate, br' -H 'x-origin: https://explorer.apis.google.com' -H 'accept-language: en-US,en;q=0.9' -H 'authorization: Bearer AuthToken' -H 'x-requested-with: XMLHttpRequest' -H 'sec-fetch-site: same-origin' -H 'x-clientdetails: appVersion=5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1&platform=Win32&userAgent=Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3829.0 Safari/537.36 Edg/77.0.197.1' -H 'content-type: application/json' -H 'accept: */*' -H 'referer: https://content.googleapis.com/static/proxy.html?usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.pt_BR.9VS-OXqJJxY.O%2Fam%3DwQE%2Fd%3D1%2Frs%3DAGLTcCOat2vY5WjTVOTl0GbC_09htXr7UQ%2Fm%3D__features__' -H 'authority: content.googleapis.com' -H 'x-javascript-user-agent: apix/3.0.0 google-api-javascript-client/1.1.0' -H 'x-referer: https://explorer.apis.google.com' -H 'origin: https://content.googleapis.com' --data-binary '{"trashed":true}' --compressed
curl 'https://content.googleapis.com/drive/v3/files/1dVyvc8x9hqRSG81gbzH7QlXdy9pVPOpF?supportsAllDrives=true&alt=json' -X PATCH -H 'sec-fetch-mode: cors' -H 'x-goog-encode-response-if-executable: base64' -H 'accept-encoding: gzip, deflate, br' -H 'x-origin: https://explorer.apis.google.com' -H 'accept-language: en-US,en;q=0.9' -H 'authorization: Bearer AuthToken' -H 'x-requested-with: XMLHttpRequest' -H 'sec-fetch-site: same-origin' -H 'x-clientdetails: appVersion=5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1&platform=Win32&userAgent=Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3829.0 Safari/537.36 Edg/77.0.197.1' -H 'content-type: application/json' -H 'accept: */*' -H 'referer: https://content.googleapis.com/static/proxy.html?usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.pt_BR.9VS-OXqJJxY.O%2Fam%3DwQE%2Fd%3D1%2Frs%3DAGLTcCOat2vY5WjTVOTl0GbC_09htXr7UQ%2Fm%3D__features__' -H 'authority: content.googleapis.com' -H 'x-javascript-user-agent: apix/3.0.0 google-api-javascript-client/1.1.0' -H 'x-referer: https://explorer.apis.google.com' -H 'origin: https://content.googleapis.com' --data-binary '{"trashed":true}' --compressed
curl 'https://content.googleapis.com/drive/v3/files/1XNte7tA6g95YOdM4Kfrr-YWs3-c6WtOZ?supportsAllDrives=true&alt=json' -X PATCH -H 'sec-fetch-mode: cors' -H 'x-goog-encode-response-if-executable: base64' -H 'accept-encoding: gzip, deflate, br' -H 'x-origin: https://explorer.apis.google.com' -H 'accept-language: en-US,en;q=0.9' -H 'authorization: Bearer AuthToken' -H 'x-requested-with: XMLHttpRequest' -H 'sec-fetch-site: same-origin' -H 'x-clientdetails: appVersion=5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1&platform=Win32&userAgent=Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3829.0 Safari/537.36 Edg/77.0.197.1' -H 'content-type: application/json' -H 'accept: */*' -H 'referer: https://content.googleapis.com/static/proxy.html?usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.pt_BR.9VS-OXqJJxY.O%2Fam%3DwQE%2Fd%3D1%2Frs%3DAGLTcCOat2vY5WjTVOTl0GbC_09htXr7UQ%2Fm%3D__features__' -H 'authority: content.googleapis.com' -H 'x-javascript-user-agent: apix/3.0.0 google-api-javascript-client/1.1.0' -H 'x-referer: https://explorer.apis.google.com' -H 'origin: https://content.googleapis.com' --data-binary '{"trashed":true}' --compressed
curl 'https://content.googleapis.com/drive/v3/files/1pQ52Qya4qv9TzvV4MxnXcXZBzlbsc3Ky?supportsAllDrives=true&alt=json' -X PATCH -H 'sec-fetch-mode: cors' -H 'x-goog-encode-response-if-executable: base64' -H 'accept-encoding: gzip, deflate, br' -H 'x-origin: https://explorer.apis.google.com' -H 'accept-language: en-US,en;q=0.9' -H 'authorization: Bearer AuthToken' -H 'x-requested-with: XMLHttpRequest' -H 'sec-fetch-site: same-origin' -H 'x-clientdetails: appVersion=5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1&platform=Win32&userAgent=Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3829.0 Safari/537.36 Edg/77.0.197.1' -H 'content-type: application/json' -H 'accept: */*' -H 'referer: https://content.googleapis.com/static/proxy.html?usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.pt_BR.9VS-OXqJJxY.O%2Fam%3DwQE%2Fd%3D1%2Frs%3DAGLTcCOat2vY5WjTVOTl0GbC_09htXr7UQ%2Fm%3D__features__' -H 'authority: content.googleapis.com' -H 'x-javascript-user-agent: apix/3.0.0 google-api-javascript-client/1.1.0' -H 'x-referer: https://explorer.apis.google.com' -H 'origin: https://content.googleapis.com' --data-binary '{"trashed":true}' --compressed
curl 'https://content.googleapis.com/drive/v3/files/1ymmxdvHlqZTggK2H5WxAYLYMTwwmh-26?supportsAllDrives=true&alt=json' -X PATCH -H 'sec-fetch-mode: cors' -H 'x-goog-encode-response-if-executable: base64' -H 'accept-encoding: gzip, deflate, br' -H 'x-origin: https://explorer.apis.google.com' -H 'accept-language: en-US,en;q=0.9' -H 'authorization: Bearer AuthToken' -H 'x-requested-with: XMLHttpRequest' -H 'sec-fetch-site: same-origin' -H 'x-clientdetails: appVersion=5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1&platform=Win32&userAgent=Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3829.0 Safari/537.36 Edg/77.0.197.1' -H 'content-type: application/json' -H 'accept: */*' -H 'referer: https://content.googleapis.com/static/proxy.html?usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.pt_BR.9VS-OXqJJxY.O%2Fam%3DwQE%2Fd%3D1%2Frs%3DAGLTcCOat2vY5WjTVOTl0GbC_09htXr7UQ%2Fm%3D__features__' -H 'authority: content.googleapis.com' -H 'x-javascript-user-agent: apix/3.0.0 google-api-javascript-client/1.1.0' -H 'x-referer: https://explorer.apis.google.com' -H 'origin: https://content.googleapis.com' --data-binary '{"trashed":true}' --compressed
curl 'https://content.googleapis.com/drive/v3/files/1fhwOPeobj_1MRo_eaY-c_MQ2B44LVc3Z?supportsAllDrives=true&alt=json' -X PATCH -H 'sec-fetch-mode: cors' -H 'x-goog-encode-response-if-executable: base64' -H 'accept-encoding: gzip, deflate, br' -H 'x-origin: https://explorer.apis.google.com' -H 'accept-language: en-US,en;q=0.9' -H 'authorization: Bearer AuthToken' -H 'x-requested-with: XMLHttpRequest' -H 'sec-fetch-site: same-origin' -H 'x-clientdetails: appVersion=5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1&platform=Win32&userAgent=Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3829.0 Safari/537.36 Edg/77.0.197.1' -H 'content-type: application/json' -H 'accept: */*' -H 'referer: https://content.googleapis.com/static/proxy.html?usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.pt_BR.9VS-OXqJJxY.O%2Fam%3DwQE%2Fd%3D1%2Frs%3DAGLTcCOat2vY5WjTVOTl0GbC_09htXr7UQ%2Fm%3D__features__' -H 'authority: content.googleapis.com' -H 'x-javascript-user-agent: apix/3.0.0 google-api-javascript-client/1.1.0' -H 'x-referer: https://explorer.apis.google.com' -H 'origin: https://content.googleapis.com' --data-binary '{"trashed":true}' --compressed
curl 'https://content.googleapis.com/drive/v3/files/1st_wpikySnsAdikUDePGqbo4bDQTEynl?supportsAllDrives=true&alt=json' -X PATCH -H 'sec-fetch-mode: cors' -H 'x-goog-encode-response-if-executable: base64' -H 'accept-encoding: gzip, deflate, br' -H 'x-origin: https://explorer.apis.google.com' -H 'accept-language: en-US,en;q=0.9' -H 'authorization: Bearer AuthToken' -H 'x-requested-with: XMLHttpRequest' -H 'sec-fetch-site: same-origin' -H 'x-clientdetails: appVersion=5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1&platform=Win32&userAgent=Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3829.0 Safari/537.36 Edg/77.0.197.1' -H 'content-type: application/json' -H 'accept: */*' -H 'referer: https://content.googleapis.com/static/proxy.html?usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.pt_BR.9VS-OXqJJxY.O%2Fam%3DwQE%2Fd%3D1%2Frs%3DAGLTcCOat2vY5WjTVOTl0GbC_09htXr7UQ%2Fm%3D__features__' -H 'authority: content.googleapis.com' -H 'x-javascript-user-agent: apix/3.0.0 google-api-javascript-client/1.1.0' -H 'x-referer: https://explorer.apis.google.com' -H 'origin: https://content.googleapis.com' --data-binary '{"trashed":true}' --compressed
curl 'https://content.googleapis.com/drive/v3/files/1xKpaojPrgqcwWgwCbWse2KGgVwjC7SaW?supportsAllDrives=true&alt=json' -X PATCH -H 'sec-fetch-mode: cors' -H 'x-goog-encode-response-if-executable: base64' -H 'accept-encoding: gzip, deflate, br' -H 'x-origin: https://explorer.apis.google.com' -H 'accept-language: en-US,en;q=0.9' -H 'authorization: Bearer AuthToken' -H 'x-requested-with: XMLHttpRequest' -H 'sec-fetch-site: same-origin' -H 'x-clientdetails: appVersion=5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1&platform=Win32&userAgent=Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3829.0 Safari/537.36 Edg/77.0.197.1' -H 'content-type: application/json' -H 'accept: */*' -H 'referer: https://content.googleapis.com/static/proxy.html?usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.pt_BR.9VS-OXqJJxY.O%2Fam%3DwQE%2Fd%3D1%2Frs%3DAGLTcCOat2vY5WjTVOTl0GbC_09htXr7UQ%2Fm%3D__features__' -H 'authority: content.googleapis.com' -H 'x-javascript-user-agent: apix/3.0.0 google-api-javascript-client/1.1.0' -H 'x-referer: https://explorer.apis.google.com' -H 'origin: https://content.googleapis.com' --data-binary '{"trashed":true}' --compressed
curl 'https://content.googleapis.com/drive/v3/files/1btL_jLjrUg3oO3y2275lcq2T5VxmESuM?supportsAllDrives=true&alt=json' -X PATCH -H 'sec-fetch-mode: cors' -H 'x-goog-encode-response-if-executable: base64' -H 'accept-encoding: gzip, deflate, br' -H 'x-origin: https://explorer.apis.google.com' -H 'accept-language: en-US,en;q=0.9' -H 'authorization: Bearer AuthToken' -H 'x-requested-with: XMLHttpRequest' -H 'sec-fetch-site: same-origin' -H 'x-clientdetails: appVersion=5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1&platform=Win32&userAgent=Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3829.0 Safari/537.36 Edg/77.0.197.1' -H 'content-type: application/json' -H 'accept: */*' -H 'referer: https://content.googleapis.com/static/proxy.html?usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.pt_BR.9VS-OXqJJxY.O%2Fam%3DwQE%2Fd%3D1%2Frs%3DAGLTcCOat2vY5WjTVOTl0GbC_09htXr7UQ%2Fm%3D__features__' -H 'authority: content.googleapis.com' -H 'x-javascript-user-agent: apix/3.0.0 google-api-javascript-client/1.1.0' -H 'x-referer: https://explorer.apis.google.com' -H 'origin: https://content.googleapis.com' --data-binary '{"trashed":true}' --compressed
curl 'https://content.googleapis.com/drive/v3/files/1TBypd04jm7s3gVo0fc61hs4Gx7Uo4E0Y?supportsAllDrives=true&alt=json' -X PATCH -H 'sec-fetch-mode: cors' -H 'x-goog-encode-response-if-executable: base64' -H 'accept-encoding: gzip, deflate, br' -H 'x-origin: https://explorer.apis.google.com' -H 'accept-language: en-US,en;q=0.9' -H 'authorization: Bearer AuthToken' -H 'x-requested-with: XMLHttpRequest' -H 'sec-fetch-site: same-origin' -H 'x-clientdetails: appVersion=5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1&platform=Win32&userAgent=Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3829.0 Safari/537.36 Edg/77.0.197.1' -H 'content-type: application/json' -H 'accept: */*' -H 'referer: https://content.googleapis.com/static/proxy.html?usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.pt_BR.9VS-OXqJJxY.O%2Fam%3DwQE%2Fd%3D1%2Frs%3DAGLTcCOat2vY5WjTVOTl0GbC_09htXr7UQ%2Fm%3D__features__' -H 'authority: content.googleapis.com' -H 'x-javascript-user-agent: apix/3.0.0 google-api-javascript-client/1.1.0' -H 'x-referer: https://explorer.apis.google.com' -H 'origin: https://content.googleapis.com' --data-binary '{"trashed":true}' --compressed
curl "https://content.googleapis.com/drive/v3/files?corpora=drive&driveId=$DRIVEID&includeItemsFromAllDrives=true&q=trashed%3Dfalse&supportsAllDrives=true&fields=files(id%2Cname)" -H 'sec-fetch-mode: cors' -H 'x-goog-encode-response-if-executable: base64' -H 'accept-encoding: gzip, deflate, br' -H 'x-origin: https://explorer.apis.google.com' -H 'accept-language: en-US,en;q=0.9' -H 'authorization: Bearer AuthToken2' -H 'x-requested-with: XMLHttpRequest' -H 'x-clientdetails: appVersion=5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1&platform=Win32&userAgent=Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1' -H 'x-javascript-user-agent: apix/3.0.0 google-api-javascript-client/1.1.0' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3829.0 Safari/537.36 Edg/77.0.197.1' -H 'accept: */*' -H 'referer: https://content.googleapis.com/static/proxy.html?usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.pt_BR.9VS-OXqJJxY.O%2Fam%3DwQE%2Fd%3D1%2Frs%3DAGLTcCOat2vY5WjTVOTl0GbC_09htXr7UQ%2Fm%3D__features__' -H 'authority: content.googleapis.com' -H 'sec-fetch-site: same-origin' -H 'x-referer: https://explorer.apis.google.com' --compressed
curl "https://content.googleapis.com/drive/v3/drives/$DRIVEID" -X DELETE -H 'sec-fetch-mode: cors' -H 'x-goog-encode-response-if-executable: base64' -H 'accept-encoding: gzip, deflate, br' -H 'x-origin: https://explorer.apis.google.com' -H 'accept-language: en-US,en;q=0.9' -H 'authorization: Bearer AuthToken3' -H 'x-requested-with: XMLHttpRequest' -H 'x-clientdetails: appVersion=5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1&platform=Win32&userAgent=Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F77.0.3829.0%20Safari%2F537.36%20Edg%2F77.0.197.1' -H 'x-javascript-user-agent: apix/3.0.0 google-api-javascript-client/1.1.0' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3829.0 Safari/537.36 Edg/77.0.197.1' -H 'accept: */*' -H 'referer: https://content.googleapis.com/static/proxy.html?usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.pt_BR.9VS-OXqJJxY.O%2Fam%3DwQE%2Fd%3D1%2Frs%3DAGLTcCOat2vY5WjTVOTl0GbC_09htXr7UQ%2Fm%3D__features__' -H 'authority: content.googleapis.com' -H 'sec-fetch-site: same-origin' -H 'x-referer: https://explorer.apis.google.com' -H 'origin: https://content.googleapis.com' --compressed
Это вывод
{
"files": [
{
"id": "1fkLANZMuX7Tl_6rTQgqFV6x2St48UcVo",
"name": "file-0010"
},
{
"id": "1dVyvc8x9hqRSG81gbzH7QlXdy9pVPOpF",
"name": "file-0005"
},
{
"id": "1XNte7tA6g95YOdM4Kfrr-YWs3-c6WtOZ",
"name": "file-0004"
},
{
"id": "1pQ52Qya4qv9TzvV4MxnXcXZBzlbsc3Ky",
"name": "file-0002"
},
{
"id": "1ymmxdvHlqZTggK2H5WxAYLYMTwwmh-26",
"name": "file-0003"
},
{
"id": "1fhwOPeobj_1MRo_eaY-c_MQ2B44LVc3Z",
"name": "file-0001"
},
{
"id": "1st_wpikySnsAdikUDePGqbo4bDQTEynl",
"name": "file-0008"
},
{
"id": "1xKpaojPrgqcwWgwCbWse2KGgVwjC7SaW",
"name": "file-0007"
},
{
"id": "1btL_jLjrUg3oO3y2275lcq2T5VxmESuM",
"name": "file-0006"
},
{
"id": "1TBypd04jm7s3gVo0fc61hs4Gx7Uo4E0Y",
"name": "file-0009"
}
]
}
{
"kind": "drive#file",
"id": "1fkLANZMuX7Tl_6rTQgqFV6x2St48UcVo",
"name": "file-0010",
"mimeType": "application/octet-stream",
"teamDriveId": "0ANMOBifriUr9Uk9PVA",
"driveId": "0ANMOBifriUr9Uk9PVA"
}
{
"kind": "drive#file",
"id": "1dVyvc8x9hqRSG81gbzH7QlXdy9pVPOpF",
"name": "file-0005",
"mimeType": "application/octet-stream",
"teamDriveId": "0ANMOBifriUr9Uk9PVA",
"driveId": "0ANMOBifriUr9Uk9PVA"
}
{
"kind": "drive#file",
"id": "1XNte7tA6g95YOdM4Kfrr-YWs3-c6WtOZ",
"name": "file-0004",
"mimeType": "application/octet-stream",
"teamDriveId": "0ANMOBifriUr9Uk9PVA",
"driveId": "0ANMOBifriUr9Uk9PVA"
}
{
"kind": "drive#file",
"id": "1pQ52Qya4qv9TzvV4MxnXcXZBzlbsc3Ky",
"name": "file-0002",
"mimeType": "application/octet-stream",
"teamDriveId": "0ANMOBifriUr9Uk9PVA",
"driveId": "0ANMOBifriUr9Uk9PVA"
}
{
"kind": "drive#file",
"id": "1ymmxdvHlqZTggK2H5WxAYLYMTwwmh-26",
"name": "file-0003",
"mimeType": "application/octet-stream",
"teamDriveId": "0ANMOBifriUr9Uk9PVA",
"driveId": "0ANMOBifriUr9Uk9PVA"
}
{
"kind": "drive#file",
"id": "1fhwOPeobj_1MRo_eaY-c_MQ2B44LVc3Z",
"name": "file-0001",
"mimeType": "application/octet-stream",
"teamDriveId": "0ANMOBifriUr9Uk9PVA",
"driveId": "0ANMOBifriUr9Uk9PVA"
}
{
"kind": "drive#file",
"id": "1st_wpikySnsAdikUDePGqbo4bDQTEynl",
"name": "file-0008",
"mimeType": "application/octet-stream",
"teamDriveId": "0ANMOBifriUr9Uk9PVA",
"driveId": "0ANMOBifriUr9Uk9PVA"
}
{
"kind": "drive#file",
"id": "1xKpaojPrgqcwWgwCbWse2KGgVwjC7SaW",
"name": "file-0007",
"mimeType": "application/octet-stream",
"teamDriveId": "0ANMOBifriUr9Uk9PVA",
"driveId": "0ANMOBifriUr9Uk9PVA"
}
{
"kind": "drive#file",
"id": "1btL_jLjrUg3oO3y2275lcq2T5VxmESuM",
"name": "file-0006",
"mimeType": "application/octet-stream",
"teamDriveId": "0ANMOBifriUr9Uk9PVA",
"driveId": "0ANMOBifriUr9Uk9PVA"
}
{
"kind": "drive#file",
"id": "1TBypd04jm7s3gVo0fc61hs4Gx7Uo4E0Y",
"name": "file-0009",
"mimeType": "application/octet-stream",
"teamDriveId": "0ANMOBifriUr9Uk9PVA",
"driveId": "0ANMOBifriUr9Uk9PVA"
}
{
"files": []
}
{
"error": {
"errors": [
{
"domain": "global",
"reason": "cannotDeleteResourceWithChildren",
"message": "This resource cannot be deleted because it has children."
}
],
"code": 403,
"message": "This resource cannot be deleted because it has children."
}
}
Особый интерес представляют два последних ответа: [2] возвращает пустой список
{
"files": []
}
Но [1] выдает ошибку.
{
"error": {
"errors": [
{
"domain": "global",
"reason": "cannotDeleteResourceWithChildren",
"message": "This resource cannot be deleted because it has children."
}
],
"code": 403,
"message": "This resource cannot be deleted because it has children."
}
}