Create Microsoft Outlook Feed

Create Microsoft Outlook feed to ingest emails and email attachments.

Graphlit supports ingesting emails and email attachments from Microsoft Outlook Email.

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 Microsoft 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 Microsoft email account.

Also, you will need to assign the Azure AD tenant for the Microsoft email account as the tenantId parameter.

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:

mutation CreateFeed($feed: FeedInput!) {
  createFeed(feed: $feed) {
    id
    name
    state
    type
  }
}

Variables:

{
  "feed": {
    "type": "EMAIL",
    "email": {
      "type": "MICROSOFT_EMAIL",
      "includeAttachments": true,
      "microsoft": {
        "tenantId": "redacted",
        "refreshToken": "redacted",
        "type": "PAST"
      },
      "readLimit": 50
    },
    "name": "Microsoft Outlook Mail"
  }
}

Response:

{
  "type": "EMAIL",
  "id": "3624ec31-8a36-4a38-80b4-5d7583457039",
  "name": "Microsoft Outlook Mail",
  "state": "ENABLED"
}

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:

mutation CreateFeed($feed: FeedInput!) {
  createFeed(feed: $feed) {
    id
    name
    state
    type
  }
}

Variables:

{
  "feed": {
    "type": "EMAIL",
    "email": {
      "type": "MICROSOFT_EMAIL",
      "includeAttachments": true,
      "microsoft": {
        "tenantId": "redacted",
        "refreshToken": "redacted",
        "type": "NEW"
      }
    },
    "schedulePolicy": {
      "recurrenceType": "REPEAT",
      "repeatInterval": "PT5M"
    },
    "name": "Microsoft Outlook Email"
  }
}

Response:

{
  "type": "EMAIL",
  "id": "334d6049-3ff3-483f-87d1-e333a8f04937",
  "name": "Microsoft Outlook Email",
  "state": "ENABLED"
}

Last updated