I am trying to send emails with the Gmail API. I am trying to use Postman to test my requests and get the proper code to use in my web application, but I keep getting this error:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalidArgument",
"message": "Recipient address required"
}
],
"code": 400,
"message": "Recipient address required"
}
}
I'm using the following link to make a POST request:
https://www.googleapis.com/upload/gmail/v1/users/me/messages/send
In my header, I have the following:
Authorization: Bearer ya29.xxxxxxxxx
Content-Type: message/rfc822
In my request body:
{
"raw" : "RnJvbTogQWxleCBCdWhzZSA8YWxleGJ1aHNlMUBnbWFpbC5jb20-IApUbzogQWxleCBCdWhzZSA8a29vX29saW9AaG90bWFpbC5jb20-IApTdWJqZWN0OiBTYXlpbmcgSGVsbG8geW8KRGF0ZTogRnJpLCAyMSBOb3YgMTk5NyAwOTo1NTowNiAtMDYwMApDb250ZW50LVR5cGU6IHRleHQvaHRtbDsgY2hhcnNldD11dGYtOA=="
}
I have tested the request with through the API testing sidebar on Google's own documentation:
https://developers.google.com/gmail/api/v1/reference/users/messages/send
but I seem to not be having any luck with using it in Postman. I'm using Postman and not the javascript that Google provides because I want to get the proper formatted code for making an AJAX call. I was wondering if anyone has worked with Postman and the Gmail API that may be able to help?