Google documentation gave an example as below:
POST /upload/gmail/v1/users/userId/messages/send?uploadType=multipart HTTP/1.1 Host: www.googleapis.com Authorization: Bearer your_auth_token Content-Type: multipart/related; boundary=foo_bar_baz Content-Length: number_of_bytes_in_entire_request_body
--foo_bar_baz Content-Type: application/json; charset=UTF-8
{ "id": string, "threadId": string, "labelIds": [ string ], "snippet": string, "historyId": unsigned long, "payload": { "partId": string, "mimeType": string, "filename": string, "headers": [ { "name": string, "value": string } ], "body": users.messages.attachments Resource, "parts": [ (MessagePart) ] }, "sizeEstimate": integer, "raw": bytes }
--foo_bar_baz Content-Type: message/rfc822
Email Message data --foo_bar_baz-- If the request succeeds, the server returns the HTTP 200 OK status code along with any metadata:
HTTP/1.1 200 Content-Type: application/json
{ "id": string, "threadId": string, "labelIds": [ string ], "snippet": string, "historyId": unsigned long, "payload": { "partId": string, "mimeType": string, "filename": string, "headers": [ { "name": string, "value": string } ], "body": users.messages.attachments Resource, "parts": [ (MessagePart) ] }, "sizeEstimate": integer, "raw": bytes }
Can someone make a sample request body by looking at the above example? I need to send an email with attachment.