Create Google Mail Feed
Create Google Email feed to ingest emails and email attachments.
Graphlit supports ingesting emails and email attachments from Google Mail.
The createFeed
mutation enables the creation of a feed by accepting the feed name
, type
and email
feed parameters and it returns essential details, including the ID, name, state, and type of the newly generated feed.
You will need to opt-in to extracting email attachments from emails, which will be ingested as new content objects, by assigning includeAttachments
to true
.
Graphlit can either read past emails, newest to oldest, or read new emails with a recurrent feed.
Reading emails from Google requires an OAuth refresh token, which must be requested by your application for the user's email account. Graphlit stores this refresh token, and will use it to request a new user token when reading from the Google email account. Also, you will need your Google OAuth client ID and client secret.
Reading Past Emails
To read past emails, you can set the type
to PAST
, and optionally set a readLimit
if you don't want to read all the past emails in your account.
Mutation:
Variables:
Response:
Reading New Emails
If you want to continually read new emails, you can assign type
field to NEW
, and configure the schedulePolicy
to repeat reading from the feed every 5 minutes.
Mutation:
Variables:
Response:
User Authentication
When using User authentication, you will need to authenticate your end-user via OAuth 2.0 and receive a refresh token for the end-user. Graphlit will use the refresh token to authenticate and enumerate emails on Google Email on your user's behalf.
More information on creating a Google OAuth client ID can be found here and here.
Last updated