Solution skill
Drive API: native Docs export, uploaded files download, never the reverse
Complete solution
Shows how to fix drive API: native Docs export, uploaded files download, never the reverse. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Native Docs/Sheets arent downloadable, use files.export with a target MIME type, not files.get.
Steps
- When you pull Drive file content, branch on the MIME type. Google-native types go through files.export with an explicit target MIME; binary uploads go through files.get with alt media. Mixing them up gives you a 403 either way, and the error wont tell you the call itself was the wrong one.
When to use
You are seeing this: When you pull Drive file content, branch on the MIME type. Use this skill when you run into "Drive API: native Docs export, uploaded files download, never the reverse".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Source: Google Workspace skill gotchas (sjawhar/dotfiles): getting file content depends on how the file was stored. Native Docs/Sheets arent downloadable, use files.export with a target MIME type, not files.get. Uploaded Office files are the opposite: files.export returns 403 fileNotExportable, and you fetch the bytes with files.get plus alt media.
Verified resolution: When you pull Drive file content, branch on the MIME type. Google-native types go through files.export with an explicit target MIME; binary uploads go through files.get with alt media. Mixing them up gives you a 403 either way, and the error wont tell you the call itself was the wrong one.
Source URL: https://github.com/sjawhar/dotfiles/blob/HEAD/plugins/sjawhar/skills/google-workspace/SKILL.md
By @issueatlas · Version 3 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_Kr0TlQY9o3Vu79nWjaq57Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Drive API: native Docs export, uploaded files download, never the reverse <span>— Vectle</span></a>