0
votes

My requirement is that send an email to some recipient with text body using POSTMAN Native app, I used the below endpoint with requested data,

  1. Base URL: https://www.googleapis.com/gmail/v1/users/userId/messages/send
  2. Headers :Authorization:Bearer
  3. Request Method :POST
  4. Request body :{"raw";"to:[email protected]","subject":"Test_Mail"}
  5. Clicking Send button

But getting error response code 400,required recipient address Please help me in this to send an email using POSTMAN,and I've tried with upload end point too -https://www.googleapis.com/upload/gmail/v1/users/[email protected]/messages/send

Thanks in advance,looking for help guys

2
Tried this one also, but no luck, guys it would be great, for help in this stackoverflow.com/questions/24460422/… I want to send mail with raw text with Gmail Rest API using postmanMahesh Durgam
Please refer https://stackoverflow.com/q/58909602/11602270 It has a detailed description of it.purav desai

2 Answers

1
votes

Came across your question trying to figure this out myself today.

  1. Request body : {"raw";"to:[email protected]","subject":"Test_Mail"}

The raw param should be a complete email message that's base64-encoded.

i.e.: {"raw": "VG86IHVzZXIxbWFpbEBnbWFpbC5jb20KU3ViamVjdDogVGVzdF9NYWls"}

0
votes

400 error means bad request, which could mean there are missing or wrong parameters. Check the Users.messages.send

Path parameters

userId string The user's email address. The special value me can be used to indicate the authenticated user.

Required query parameters

uploadType string The type of upload request to the /upload URI. Acceptable values are:

media - Simple upload. Upload the media only, without any metadata.

multipart - Multipart upload. Upload both the media and its metadata, in a single request.

resumable - Resumable upload. Upload the file in a resumable fashion, using a series of at least two requests where the first request includes the metadata.