How can i create http request node to send email or create draft in gmail?

I have a workflow for send, get, reply email and i prefer to use http request node to do this. Get emails can run successfully.

But Send email or create labels can not run .

My credential is correct because i have use it in get emails.

If you read this, could you please stay a moment and help me?
Thanks in advance.

I see you using the bearer token so you are not using google oauth.

Can you confirm your api have all the gmail scopes?

YES !! I using https://mail.google.com for full access. In my case , i want to use access token from user to authen instead of credential in n8n. Then i tried get access token in Oauth2 Playground to get it.

For create label

this request code works


For sending email. You might need to look into the API doucment carefully.

2 Likes

That work !! The problem is what i send in my body. Maybe I’m missing some fields.
How do I know if a field is required?
Thank you so much.

I would suggest you can test the payload here first

It’s what I did for the create label.

Wow that help !!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.