Reputation: 33
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,
Authorization:Bearer
POST
{"raw";"to:[email protected]","subject":"Test_Mail"}
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
Upvotes: 0
Views: 8389
Reputation: 206
Came across your question trying to figure this out myself today.
- 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"}
Upvotes: 1
Reputation: 17613
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.
Upvotes: 0