Using Graph API for Third-party SMS integration

Using Graph API for Third-party SMS integration

Modern workplace needs integration with third party solutions to provide better user experience. I am going to discuss a basic integration scenario and outline how easy it is to access your existing data using Graph API rather than managing information in silos.

We have numerous ways to achieve one task. This is one of the ways:

Scenario: Company ABC need to trigger SMS to a group of users based on some event. ABC is using 3rd party SMS providers such as ClickSend.

Requirement: Company ABC wants an IT vendor to host the integration solution and send SMS to group of users. They don't want to manage user's mobile number in SMS provider portal. Proposed solution should get the Azure AD groups and access group members mobile number to send the SMS.

Constraint: Company ABC does not want to create any service account due cost consideration. Does not want to create Power Automate in their environment.

Solution: IT Vendor proposes to use Logic App and expose the Logic app as webhook. When the webhook is initiated with a payload then it will extract the content for the SMS. Then Logic App will use HTTP action to query Graph API to get the group members mobile number and display name. Next we can initiate API exposed from the third party SMS provider to send the custom SMS to the user group.

As we are not maintaining the user mobile information in SMS provider portal, this solution provide dynamic user management centrally from Azure AD. Business users such as communication Team does not have to maintain list of mobile numbers

Following are the steps.

Register an Azure AD app in Company ABC azure AD tenant.

  1. Navigate to Azure AD Portal, Click on App Registration > New Registration

No alt text provided for this image
Image 1

2. Provide a name to and select Multitenant option

No alt text provided for this image
Image 2


3. Now we have to provide API permission. Click on Add a permission > Microsoft Graph > Application Permission > Select a permission such as Group.Read.All


No alt text provided for this image
Imag 3

4. Once you add all the required permission. You have to grant the Admin consent

No alt text provided for this image
Image 4

5. Now we have to generate a client secret that we will use along Application ID and tenant ID to access the Graph API in Logic App. Click on the Certificate and Secrets > New Client Secret > Provide a name and validity of the secret.


No alt text provided for this image

6. Copy the value of secret securely as we will need it later.

No alt text provided for this image

Add a Http Request action in Logic App to access Graph API

  1. Before we add HTTP request action, we need Client ID and Tenant ID, Secret value. Click on the overview of custom app that we have created in above step.

No alt text provided for this image

2. We also need to get the Group ID for which we will retrieve group members. Navigate to Azure AD > Groups > Select the group and click on Overview. Copy the object ID of the group

No alt text provided for this image


3. Navigate to your logic App or Power Automate. Click on the HTTP action.

Select GET method, provide the Graph API URL. Select Authentication Type as Active Directory OAuth and provide Tenant ID, Audience, Client ID and Credential Type ( Secret) and Secret Value.


No alt text provided for this image


3. Here is the magic part when you run the Logic App then you can see, we are able to retrieve all group member with their information such email address, mobile.

No alt text provided for this image

To view or add a comment, sign in

Others also viewed

Explore content categories