Both ChatGPT and Bard give the following instructions, however there are no roles related to Gmail. So has anything changed or is there another way?
When trying to use the service account currently, I get the following error:
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://gmail.googleapis.com/gmail/v1/users/me/profile?alt=json returned "Precondition check failed.". Details: "[{'message': 'Precondition check failed.', 'domain': 'global', 'reason': 'failedPrecondition'}]
To give the service account access to read Gmail emails, you need to grant it the Gmail API Viewer role. You can do this by following these steps:
Solved! Go to Solution.
I have pretty much a guide on readme of one of scripts here: https://github.com/sapn1s/gmail-email-checker
You do not need gmail.modify permission if you just want to read the emails.
Just for running on server without gui, you need to open the auth URL on an actual browser anywhere and just paste the code, after that it would remember your session.
User | Count |
---|---|
3 | |
1 | |
1 | |
1 |