Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
titlelistDrafts
<gmail.listDrafts>
	<maxResults>{$ctx:maxResults}</maxResults>
    <pageToken>{$ctx:pageToken}</pageToken>
</gmail.listDrafts>
Properties
  • maxResults: Maximum number of messages to return.
  • pageToken: Page token to retrieve a specific page of results in the list.

...

Code Block
languagexml
titlegetADraft
<gmail.readDraft>
	<id>{$ctx:id}</id>
    <format>{$ctx:format}</format>
</gmail.readDraft>
Properties
  • id: The ID of the draft to retrieve
  • format : The format to return the draft in

...

Code Block
languagexml
titlecreateDraft
<gmail.createDraft>
	<to>{$ctx:to}</to>
    <subject>{$ctx:subject}</subject>
    <from>{$ctx:from}</from>
    <cc>{$ctx:cc}</cc>
    <bcc>{$ctx:bcc}</bcc>
    <id>{$ctx:id}</id>
    <threadId>{$ctx:threadId}</threadId>
    <messageBody>{$ctx:messageBody}</messageBody>
	<contentType>{$ctx:contentType}</contentType>
 </gmail.createDraft> 
Properties
  • to: The email address of the recipient of this email.
  • subject: Subject of the email.
  • from: The email address of the sender of the email.
  • cc: The email addresses of recipients who will receive a copy of this email.
  • bcc: The email addresses of recipients who will privately receive a copy of this email (their email addresses will be hidden).
  • threadId: ID of the thread.
  • id: ID of the email.
  • messageBody: Content of the email.
  • contentType: If the message body is in the format of html or need to send a rich text then we must give the parameter value as "text/html; charset=UTF-8" otherwise it takes the default value as text/plain.
Sample request

Following is a sample REST/JSON request that can be handled by the createDraft operation.

Code Block
languagexml
titleSample Request for createDraft
{
  "to":"tharis63@hotmail.com",
  "from":"tharis63@gmail.com",
  "subject":"test",
  "messageBody":"Hi hariprasath",
  "cc":"tharis63@outlook.com",
  "bcc":"tharis63@yahoo.com",
  "id":"154b8c77e551c509",
  "threadId":"154b8c77e551c509"
  "contentType":"text/html; charset=UTF-8"
 }
Related Gmail documentation

...