I am trying to compose drafts programmatically via the GMail API, using this tutorial and the following line of code:
service.users().drafts().create(userId=user_id, body=message).execute()
but I receive the following error:
An error occurred: <HttpError 403 when requesting https://www.googleapis.com/gmail/v1/users/me/drafts?alt=json returned "Insufficient Permission">
Note that directly sending messages with gmail.send
privileges does not work for me - I want to thread messages.
In the API console, I tried enabling the following scope ../auth/gmail.compose
, but there is a warning message that Because you've added a sensitive scope, your consent screen requires verification by Google before it's published.
I have submitted my app for verification, but I just received an email stating that "We've extended the deadline to fully complete your verification from May 15th to June 26th, 2019".
Actually, no users will use my G Suite email accounts (so my app cannot be used to spy on their messages) and I only need access to a single email account info@example.com
to send notifications to users who use my site on example.com
.
Is there any way to get server-side access to my info@example.com
account using my password and programmatically draft messages without having to go through the lengthy and unnecessary app verification process?