Let's say my app is an integration with M365/Outlook and has a trigger "When email is flagged in Outlook"...
I need to create this automation block as a trigger with:
- A subscribe URL - create the incoming webhook subscription from Outlook to listen to events
- An unsubscribe URL - deletes the incoming webhook from Outlook
Both of these will use the credentials feature and monday will pass me a valid, but short lived access token for use with Microsoft 365.
Here's the hard part...
I also need to regularly update the Microsoft Graph to renew the webhook subscription (as mail subscriptions expire after 3 days)
This will need to be done with a monday-code cron job which:
- requests a new access token from monday for the correct user
- sends the webhook subscription renewal to Microsoft
In the old infra, we’d use a credentials field and handle the logic ourselves, in our app, but with the new infra, the credentials are stored by monday and are abstracted away completely.
👉 How do I request a new Microsoft access token from monday???
👉 Is this even possible?