gain access to outlook using Microsoft Graph API via ASP.NET-MVC

I am developing a web application using ASP.NET-MVC that uses the Microsoft graph API to gain access to the outlook account of the user who has signed in. Whenever a new mail arrives, the web application should send a notification to the person on the desktop and to his phone as well.

I have successfully fetched the mail using the Microsoft graph API but I am unable to refresh the view automatically when a new mail is received in the account. If I am trying to do so, an error occurs throwing a null exception by the access token variable. I have followed this link: https://docs.microsoft.com/en-us/outlook/rest/dotnet-tutorial

Please suggest some ways as I am new to ASP.NET-MVC