Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
In this tutorial, we will show the process of sending emails using Microsoft Graph API with Joget JSON Tool. The guideline will help you automate the process of sending emails, making it a more efficient and streamlined process. This article will provide a step-by-step guide to help set up and send emails using Microsoft Graph API and Joget JSON Tool.
Before going to Joget to use the Microsoft Graph API, we first must create the Azure application that has the permission to use this API, follow the steps below and you will have everything you need to send emails using the Microsoft Graph API.
To start creating your Azure application, you must first sign up on Azure here, but simply signing up using your personal Microsoft account wouldn't work as it won't give you full access to Azure. To get this access, you will need to join the Microsoft Developer program.
To join the Microsoft Developer program, simply sign up on their website with your personal Microsoft account, and get yourself a Microsoft 365 Developer subscription, you can either purchase it, or get a 90 day free trial.
Use the email in the "Administrator" section to sign up for your Azure account and this time you will have full access to it.
So now with the Azure account set up, we can begin registering an application.
To register an application go to:
After this you should see in the overview you have an "Application (client) ID" and a "Directory (tenant) ID", these two are important so that your API call will actually be using your app and your account.
Next up is to get your client secret.
To do this, from the app's overview page, go to:
After doing so, you now should have a "value" and "ID", copy paste this "value" somewhere like a Notepad.
Client Secret Value
Make sure you secure this value before leaving or refreshing the page as the value will become hidden afterwards.
Last thing to do is to give the Azure app the permission to send emails via the Microsoft Graph API.
To do this, from the app's overview page, go to:
And now your Azure app has the permission to send emails!
The Joget JSON Tool is a plugin for app processes that lets you issue JSON web service calls. In order to properly send an email with the MS Graph API, you will need in total 2 of these JSON tools. One to request for an access token and the other to actually send the email.
Courtesy to Microsoft's documentation, to acquire the access token, you will need a POST request to the url:
https://login.microsoftonline.com/[TENANT ID HERE]/oauth2/v2.0/token
So, enter these appropiate information into your first JSON Tool and keep the Body Type as "Request Parameters"
Here is the demo app that showcases this guide, please do keep in mind all of the information related to the Azure app has been left empty since those should be filled with your own Azure app. Most of these empty information can be find in the process of the application.