0

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:user1mail@gmail.com","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/user1email@gmail.com/messages/send

Thanks in advance,looking for help guys

Brane
  • 3,257
  • 2
  • 42
  • 53
Mahesh Durgam
  • 33
  • 1
  • 9
  • Tried this one also, but no luck, guys it would be great, for help in this https://stackoverflow.com/questions/24460422/how-to-send-a-message-successfully-using-the-new-gmail-rest-api I want to send mail with raw text with Gmail Rest API using postman – Mahesh Durgam Dec 05 '17 at 07:30
  • Please refer [https://stackoverflow.com/q/58909602/11602270](https://stackoverflow.com/q/58909602/11602270) It has a detailed description of it. – Purav Uday Desai Nov 18 '19 at 07:19

2 Answers2

1

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

  1. Request body : {"raw";"to:user1mail@gmail.com","subject":"Test_Mail"}

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

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

the_cuaz
  • 206
  • 1
  • 5
0

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.

ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56