Hi everyone,
I’ve been trying to integrate the Gmail API to send emails from my Xano backend. I followed the Gmail API documentation and even got some help from GPT, but I still can't get it to work.
Every time I try to send an email, I receive the following error from Google:
POST request to https://gmail.googleapis.com/gmail/v1/users/me/messages/send
My request body is:
{
"body": {"raw": "Q29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyBjaGFyc2V0PSJVVEYtOCIKTUlNRS1WZXJzaW9uOiAxLjAKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogN2JpdAp0bzogam9obmRvZUBnbWFpbC5jb20KZnJvbTogamFuZWRvZUBnbWFpbC5jb20Kc3ViamVjdDogdGVzdAoKdGVzdA"
}
}
of course, I used real emails. This is just an example raw format
I’ve verified that I can use the Google Calendar API to schedule events without any issues, so I’m confident that the authentication part is working correctly.
For the scopes, I’ve been using gmail.send
and gmail.readonly
. However, my app is not yet verified by Google. Could this be the reason? Is it possible that the gmail.send
scope is a restricted scope and requires verification to use?
Any guidance or suggestions would be really appreciated!
Thanks in advance!