📢 New on-demand webinar: Extend AI capabilities in M-Files without coding!  WATCH NOW

📢 New on-demand webinar: Extend AI capabilities in M-Files without coding!  WATCH NOW

Notifications
Clear all

HTTP module, Authorization requires a fresh bearer token (Microsoft 365 Business Central)

0
[#153]
Topic starter

Getting access to the BC API we need to provide a bearer token for Authorization. It can be created in Postman, Authorization, Auth Type "OAuth 2.0" using a URL like this https://login.microsoftonline.com/{tenant id}/oauth2/v2.0/authorize while providing the Client ID and Client Secret. The challenge is that this token is only valid for a short period (a couple of days I believe). Therefor I need to configure a process that retrieves a fresh token on regular intervals and saves it to a property in M-Files. That should enable the use of the same property for dynamic insertion of the valid token in the header of any regular POST or GET operation.

It can be operated on a schedule, but I am not quite sure how to configure the "get a fresh bearer token" process. It does not seem to be a regular "GET" operation. Any suggestions on how to do this part?

The screenshot is from Postman.

BC get new access token