Creating Outlook Meetings from your Mendix app
Creating Outlook Meetings from your Mendix app

Creating Outlook Meetings from your Mendix app

Published in
6 min readJan 10, 2022

--

Automate being organised in 2022

Meeting invites — something every modern day worker uses or sends on a daily basis. But did you know you can create calendar invites using an integration to Microsoft 365? In this blog I will cover how to create and send calendar invites from your Mendix app and explain how it all works. So read along to get organised and automate your meeting invites in the new year.

Steps to Creating a Meeting in your Mendix APP:

Step-1:

We need an account to access Azure Active Directory. Create the developer account which has full admin access with the help of the Microsoft 365 Developer Program Membership.

Click here to set up a new Microsoft 365 E5 Subscription.

Note: Your Microsoft 365 Account will be valid only for 90 days.

Step-2:

After Creating an account use this link to check wether your selected Microsoft apps are created are not.

Step -3:

If you want to check if your account is active or not, use this link to check your account status.

What is Azure?

It is a cloud computing platform and an online portal to access and manage resources and services provided by Microsoft resources and services

What is Client ID?

It is an Identifier for your Azure App. This identifier will be assigned when a Sequence is set up as an application in the directory

What is Client Key?

It’s one of your Azure App identifiers. The secret key Sequence your app will use when communicating with AAD(Azure Active Directory). It expires based on the months of your App.

What is Tenant Id?

It is the tenant which is identified by a GUID(globally unique identifier),
For Example: Apps registered in Azure AD which use the Graph APIs to access tenant data must pass the tenant identifier along with the app identifier and app secret when requesting an access token, that’s why it’s a unique identifier.

To Create an App in Azure Active Directory , continue to follow these steps:

Step-4:

Sign into https://portal.azure.com/ with a developer account and open Azure’s Active Directory Overview.

Step -5:

Click Enterprise Applications from the left side navigation bar.

Step -6:

Click the New application button from the top of the screen and choose Nongallery application from the application types listed over there.

Step 7:

Enter the Name of the application and click Add.

Step 8:

Choose SAML from the single sign-on method.

Your app has ClientID and Tenant ID If you want to check, what is client ID and Tenant Id ( please refer To the above explanation of AAD)

Step 9:

Click Client credentials to generate client Secrets.

Step 10:

Set the expiry date of client Secret ID and Click add and you will get client secret ID and Value

NOTE: If you are going to use client secret ID, We need to use the value

Step 11:

Click API permission and give access to the app like mails, calendar and teams

Step 12:

Click Add a permission to give access to which you create the app in API Permission

PERMISSIONS:

Type of Permission:

  • Delegated Permission:

Delegated permissions are used by apps that have a signed-in user present.

  • Application Permission:

Application permissions are used by apps that run without the signed-in user present.

How to Implement in Mendix?

Why do we need to generate the access token?

We are using third-party URLs or services to achieve in our application we need to generate access tokens here we doing with the client ID and tenant ID.

How to Generate the access token Using Mendix?

HTTP Method :

POST

Location : https://login.microsoftonline.com/{tenant_ID}/oauth2/v2.0/token?

Headers :

Content-Type: application/x-www-form-urlencoded

Request Template:

Creating meetings in Microsoft Using your Mendix app

HTTP Method :

POST

Location:

https://graph.microsoft.com/v1.0/users/{EmailID}/events?Prefer

Headers:

Authorization: ‘Bearer ‘ + #AccessToken#

Content-type: ‘application/json’

You have send the entire request as input, using an export mapping to send the request.

Once You executed the microflow you will be able to see the invite link in your calendar, In the Mendix app by means of using the calendar widget.

How to get an email from Outlook?

HTTP Method:

GET

Location: https://graph.microsoft.com/v1.0/users/{EmailID}/mailFolders/Inbox/Messages

Headers:

Authorization: Bearer #token# (we got access token in generating access token process)

Content-Type:application/json

Note: If you want to retrieve any specific folder, make sure you configured the same folder name in your rest call

For Example: If you need to retrieve mails from the draft, then provide a draft in your rest call service.

I hope this tutorial on how to implement the creation of meetings using Azure Active Directory and Mendix. Remember to display the meetings in your Mendix app you can use the calendar widget available for download in the Marketplace

( https://docs.mendix.com/appstore/widgets/calendar#2-basic-configuration).

See you in the next article! Please post your comments if you have any questions :)

Make sure to check out the OIDC Module on the Marketplace — It can make this integration even easier!

Read More

From the Publisher -

If you enjoyed this article you can find more like it at our Medium page. For great videos and live sessions, you can go to MxLive or our community Youtube page.

For the makers looking to get started, you can sign up for a free account, and get instant access to learning with our Academy.

Interested in getting more involved with our community? You can join us in our Slack community channel or for those who want to be more involved, look into joining one of our Meet ups.

--

--