I have written a script which calls the Microsoft outlook api, and retrieves mails from a specific user. This is working great so far. What I need to do though is to be able to call this api, say every 5 mins, and retrieve new mails, which can then be posted and displayed in a moodle plugin on the Moodle site. My problem now is that I have to "refresh" the token and cookies every hour by signing into outlook!
Does anyone know how I can get past this? I need to sign-in once, and be able to automate calls to outlook mails api via the app id and secret, and whatever tokens i get from the api.