shirbr510 / microsoft-graph-notification-server-example

a minimal example of a notification service to receive notifications from Microsoft Graph subscriptions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

microsoft-graph-notification-server-example

a minimal example of a notification service to receive notifications from Microsoft Graph subscriptions

Running the server

in order to run the server, you have 2 choices:

  1. locally:
    • npm install
    • npm start
  2. docker:
    • docker-compose up

Receiving Notifications

in order to do that, you need to subscribe the service to microsoft graph.

this can be done in one of 2 ways:

  1. use Microsoft Graph Exlporer
  2. perform a proper POST request to Microsoft Graph Subscription Endpoint.

you can use the following sample as your body:

{
  "changeType": "created, updated, deleted",
  "notificationUrl": "<your server's https url>",
  "resource": "me/messages",
  "expirationDateTime": "2019-08-03T18:23:45.9356913Z"
}

pay attention the notificationUrl MUST be an https endpoint

About

a minimal example of a notification service to receive notifications from Microsoft Graph subscriptions

License:Apache License 2.0


Languages

Language:JavaScript 74.3%Language:Dockerfile 25.7%