Use Case - Caller Information from Graph

Set up Nimbus to enable looking up internal user numbers from within your Azure AD directory.

In this use case, we're going to describe how you can set up Nimbus to look up internal user numbers from within your Azure AD directory.

By default, Nimbus does not perform this reverse lookup, but via Power Automate and our Nimbus Power Automate Connector you can use a Microsoft Graph Query to perform this task.

PRECONDITIONS 

  • Tenant Admin rights to access your user AD and perform this Flow on behalf of all your services
  • Power Automate "Premium" license (to use the HTTP action)
  • Phone numbers maintained in Azure AD must be stored in valid E.164 format or a predictable pattern - otherwise our query won't find any matches
  • An App Registration (in case you are still using the Nimbus Custom Connector instead of the certified Power Automate Connector , you can use the App Registration used by that connector), which must grant User.Read.All application permissions for the Graph API.
 

NOTES

This example is giving priority to the first found result returned by the Graph query. Other potential matches will not be considered.

🔎 See https://docs.microsoft.com/en-us/graph/query-parameters for more query customization options to fine-tune your search.

 

CLIENT SECRET EXPOSURE

Within the HTTP action in this example the client secret value is stored in clear text  
→ You must therefore ensure that this data is not exposed to anyone without proper authorization. 
→ Alternatively, you can also use the "Get secret" Action, available as part of the built-in Azure Key Vault Connector in Power Automate.

✅ This is a Microsoft Azure feature which requires a "Premium license" plus an "Azure Key Vault" which consumes Azure Storage Resources that will incur additional costs outside of your Nimbus subscription.

 

Flow Overview

This flow consists of the following steps: 

Start Flow

  1. Go to the Flow landing page.
  2. Go to "My Flows".
  3. Click "+ New Flow" and create a blank "Automated Cloud Flow".
  4. Give your new flow a meaningful name, e.g. "Create entry in list".
  5. In the text box underneath, search for “Nimbus” and choose the “When a task changes state” trigger.
  6. Click the Create button. 
  7. Select the “When a task changes state” trigger.
  8. In the “Services Item” dropdown, select the Nimbus service's UPN. 
    💡 You can also get the data of multiple services at this point, but for the sake of simplicity we keep it to one service in this example.
  9.  In the “Task Events” dropdown select “System Accepted”.
  10. In the “Advanced parameters” dropdown enable “Modalities” and "Directions".
  11. In the “Modalities Item” dropdown select “Audio”.
  12. In the “Directions Item” dropdown select “Inbound”.

Initialize variable

To convert the Nimbus data for Graph Query, a variable needs to be initialized using Nimbus data.

  1. In the editing area click to add a new action.
  2. Search for "initialize variable" and select “Initialize variable” under the “Variable” section.
  3. Configure the action as follows:
Field Value to fill in / 🌟 = Nimbus dynamic content 
Name CallerID
Type String
Value

This expression will replace any occurrence of a "+" sign in the E.164 number with a "%2B" equivalent → ☝ this is necessary as otherwise the HTTP query won't work

 replace(triggerOutputs()?['body/MicrosoftCallerId'],'+','%2B')

HTTP GET Request via Graph API

Next we use the variable to form a Graph Query via the HTTP step. Configure it as follows:

  1. In the editing area click to add a new action.
  2. Search for "HTTP" and select “HTTP” under the “HTTP” section.
  3. Configure the action as follows:
Field Value to fill in / 🌟 = Nimbus dynamic content 
URI

https://graph.microsoft.com/v1.0/users?$filter=businessPhones/any(s:s eq '@{variables('CallerID')}') or mobilePhone eq '@{variables('CallerID')}'&$count=true&$top=1&$select=businessPhones,city,companyName,country,department,displayName,givenName,imAddresses,jobTitle,mail,mobilePhone,postalCode,streetAddress,state,surname,userPrincipalName

If you have chosen a different name for the dynamic variable from the previous step, then you will need to replace CallerID accordingly.

Method GET
Headers

Enter the following key/value pair:

Key
Value
ConsistencyLevel eventual
Authentication Active Directory OAuth
Authority https://login.microsoft.com
Tenant

Directory (tenant) ID

🤔 Where to get this info? 
Retrieved from the App Registration Overview. See instructions below.

Audience https://graph.microsoft.com
Client ID

Application (client) ID

🤔 Where to get this info? 
Retrieved from the App Registration Overview. See instructions below.

Credential Type Secret
Secret

Client Secret Value

🤔 Where to get this info? 
Retrieved from the App Registration Overview. See instructions below.

☝ The value can only be viewed & copied directly after creation, so you may need to create a new client secret in your App Registration.

Where to get the App Registration

As a Tenant Admin, head to https://portal.azure.com and find your Nimbus App Registration (established during Nimbus Installation).

 
 

Parse JSON

With the search result returned by the previous HTTP step, we can now parse the Azure AD information to retrieve the individual user fields:

  1. In the editing area click to add a new action.
  2. Search for "Parse JSON" and select “Parse JSON” under the “Data Operation” section.
  3. Configure the action as follows:
Field Value to fill in / 🌟 = HTTP dynamic content 
Content 🌟 Body
Value

Add the following JSON Schema

{
  "type": "object",
  "properties": {
    "@@odata.context": {
      "type": "string"
    },
    "@@odata.count": {
      "type": "integer"
    },
    "value": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "businessPhones": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "city": {
            "type": "string"
          },
          "companyName": {},
          "country": {
            "type": "string"
          },
          "department": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "givenName": {
            "type": "string"
          },
          "imAddresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "jobTitle": {
            "type": "string"
          },
          "mail": {
            "type": "string"
          },
          "mobilePhone": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "streetAddress": {
            "type": "string"
          },
          "state": {},
          "surname": {
            "type": "string"
          },
          "userPrincipalName": {
            "type": "string"
          }
        },
        "required": [
          "businessPhones",
          "city",
          "companyName",
          "country",
          "department",
          "displayName",
          "givenName",
          "imAddresses",
          "jobTitle",
          "mail",
          "mobilePhone",
          "postalCode",
          "streetAddress",
          "state",
          "surname",
          "userPrincipalName"
        ]
      }
    }
  }
}

Update Task

Finally we update the current Nimbus task with the Update Task action.

  1. In the editing area click to add a new action.
  2. Search for "Nimbus" and select “Update task” under the “Luware Nimbus” section.
  3. Configure the action as follows:
Field Value to fill in / 🔃 = Nimbus dynamic content / ❴ ❵ = Parse JSON dynamic content
Task ID 🔃 Task ID
Customer First Name ❴ ❵ givenName
Customer Last Name ❴ ❵ surname
Customer Display Name ❴ ❵ displayName
Customer Company ❴ ❵ companyName
Customer Job Title ❴ ❵ jobTitle
Customer Department ❴ ❵ department
Customer Street Address ❴ ❵ streetAddress
Customer Postcode ❴ ❵ postalCode
Customer City ❴ ❵ city
Customer State ❴ ❵ state
Customer Country ❴ ❵ country
Customer Primary Telephone Number
if(empty(item()?['businessPhones']),null,item()?['businessPhones'][0])
Telephone Numbers

Click on to and add

[
                                            {
                                                "name": "Mobile",
                                                "value": @{item()?['mobilePhone']}
                                            }
                                        ]
Customer UPN ❴ ❵ userPrincipalName
Customer IM Address
if(empty(item()?['imAddresses']),null,item()?['imAddresses'][0])
Customer Email ❴ ❵ mail

Table of Contents