Connectors of org.wso2.ballerina.connectors.gmail package
connector ClientConnector (string userId, string accessToken, string refreshToken, string clientId, string clientSecret)
Gmail client connector
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
userId | string | The userId of the Gmail account which means the email id |
accessToken | string | The accessToken of the Gmail account to access the gmail REST API |
refreshToken | string | The refreshToken of the Gmail App to access the gmail REST API |
clientId | string | The clientId of the App to access the gmail REST API |
clientSecret | string | The clientSecret of the App to access the gmail REST API |
action createDraft()
Create a draft
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
to | string | Receiver mail ID |
subject | string | Subject of the message |
from | string | Sender mail ID |
messageBody | string | Entire message body |
cc | string | To whom sender need to cc the mail |
bcc | string | To whom sender need to bcc the mail |
id | string | Id of the draft to create |
threadId | string | thread Id of the draft to reply |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action createLabel()
Create a new label
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
labelName | string | The display name of the label |
messageListVisibility | string | The visibility of messages with this label in the message list in the Gmail web interface |
labelListVisibility | string | The visibility of the label in the label list in the Gmail web interface |
types | string | The owner type for the label |
messagesTotal | string | The total number of messages with the label |
messagesUnread | string | The number of unread messages with the label |
threadsTotal | string | The total number of threads with the label |
threadsUnread | string | The number of unread threads with the label |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action deleteDraft()
Delete a particular draft
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
draftId | string | Id of the draft to delete |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action deleteLabel()
Delete a particular label
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
labelId | string | Id of the label to delete |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action deleteMail()
Delete a particular message
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
messageId | string | Id of the message to delete |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action deleteThread()
Delete a particular thread
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
threadId | string | Id of the thread to delete |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action getUserProfile()
Retrieve the user profile
Parameters:
Parameter Name | Data Type | Description |
---|
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action listDrafts()
Lists the drafts in the user's mailbox
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
includeSpamTrash | string | Include messages from SPAM and TRASH in the results |
maxResults | string | Maximum number of messages to return |
pageToken | string | Page token to retrieve a specific page of results in the list |
q | string | Only return messages matching the specified query. Supports the same query format as the Gmail search box |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action listHistory()
Lists the history to of all changes to the given mailbox
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
labelId | string | Only return messages with a label matching the ID |
maxResults | string | Maximum number of messages to return |
pageToken | string | Page token to retrieve a specific page of results in the list |
startHistoryId | string | Returns history records after the specified startHistoryId |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action listLabels()
Lists all labels in the user's mailbox
Parameters:
Parameter Name | Data Type | Description |
---|
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action listMails()
Lists the messages in the user's mailbox
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
includeSpamTrash | string | Include messages from SPAM and TRASH in the results |
labelIds | string | Only return messages with labels that match all of the specified label IDs |
maxResults | string | Maximum number of messages to return |
pageToken | string | Page token to retrieve a specific page of results in the list |
q | string | Only return messages matching the specified query. Supports the same query format as the Gmail search box |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action listThreads()
Lists the threads in the user's mailbox
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
includeSpamTrash | string | Include messages from SPAM and TRASH in the results |
labelIds | string | Only return messages with labels that match all of the specified label IDs |
maxResults | string | Maximum number of messages to return |
pageToken | string | Page token to retrieve a specific page of results in the list |
q | string | Only return messages matching the specified query. Supports the same query format as the Gmail search box |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action modifyExistingMessage()
Modifies the labels on the specified message
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
messageId | string | The ID of the message to modifies the labels |
addLabelIds | string | A list of IDs of labels to add to this message |
removeLabelIds | string | A list IDs of labels to remove from this message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action readDraft()
Retrieve a particular draft
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
draftId | string | Id of the draft to retrieve |
format | string | The format to return the draft in |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action readLabel()
Retrieve a particular label
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
labelId | string | Id of the label to retrieve |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action readMail()
Retrieve a particular Message
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
messageId | string | Id of the message to retrieve |
format | string | The format to return the Message in |
metaDataHeaders | string | When given and format is METADATA, only include headers specified |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action readThread()
Retrieve a particular Thread
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
threadId | string | Id of the thread to retrieve |
format | string | The format to return the thread in |
metaDataHeaders | string | When given and format is METADATA, only include headers specified |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action sendMail()
Send a mail
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
to | string | Receiver mail ID |
subject | string | Subject of the message |
from | string | Sender mail ID |
messageBody | string | Entire message body |
cc | string | To whom sender need to cc the mail |
bcc | string | To whom sender need to bcc the mail |
id | string | Id of the mail to send |
threadId | string | thread Id of the mail to reply |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action trashMail()
Trash a particular message
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
messageId | string | Id of the message to Trash |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action trashThread()
Trash a particular thread
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
threadId | string | Id of the thread to Trash |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action unTrashMail()
UnTrash a particular message
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
messageId | string | Id of the message to unTrash |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action unTrashThread()
UnTrash a particular thread
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
threadId | string | Id of the thread to unTrash |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action updateDraft()
Update a draft
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
draftId | string | Id of the draft to update |
to | string | Receiver mail ID |
subject | string | Subject of the message |
from | string | Sender mail ID |
messageBody | string | Entire message body |
cc | string | To whom sender need to cc the mail |
bcc | string | To whom sender need to bcc the mail |
id | string | Id of the draft to reply |
threadId | string | thread Id of the draft to reply |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |
action updateLabel()
Update a particular label
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
labelId | string | The Id of the label to update |
labelName | string | The display name of the label |
messageListVisibility | string | The visibility of messages with this label in the message list in the Gmail web interface |
labelListVisibility | string | The visibility of the label in the label list in the Gmail web interface |
types | string | The owner type for the label |
messagesTotal | string | The total number of messages with the label |
messagesUnread | string | The number of unread messages with the label |
threadsTotal | string | The total number of threads with the label |
threadsUnread | string | The number of unread threads with the label |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
message | response object |