to access the file you need the service account to have acces to the file you can do it by
Find your service account email from your JSON credentials file - it looks like: [email protected]
Open your Google Doc in the browser
Click the "Share" button in the top right
Add the service account email as an editor/viewer
Make sure to check these settings:
"Notify people" should be unchecked Click "Send" or "Share" to confirm
hopes it work