Use Case - Looking Up Phone Numbers via API

Submit an API request to in order to look up unknown phone numbers. and are services of the Swisscom Directories ( The platform’s core product is basically Switzerland’s phone directory and services range from presence & marketing services to online service tools (such as online booking & reservation, online payment, website builder, comparison platform.) provides contact information in form of a classical phone book directory. One can use their API to query the directory.

As of  the terms of service states: “The monthly usage quota per customer and API-Key is 1000 requests. A maximum of 20 results are provided per request.” Therefore, we can freely use the API, but should limit the requests. This means that we need to store it in our local CRM system to avoid re-querying it each time. Storage is allowed, but we need to comply to the terms of use (“Permitted types of use“). When storing information, source reference must be provided with all forms of API usage: “Swisscom Directories AG“.

☝ Please note that the terms of use can change any time! Before implementing this flow, please check Phone directory - API Terms of Use -



  • API key. You can request a key here: 🔍 Note that keys might be limited to one per company.
  • Power Automate Premium licence (required to make use of "HTTP requests")
  • A CRM connected to Power Automate

How-to Steps

Initialize the variables

✅ In our example we need to initialize two variables to handle throughout the flow:

  1. APIKey (String) as container for your API request
  2. searchQuery (String) - in our example we use the phone number which is stored in Nimbus as “MicrosoftCallerID”  

First internal CRM check

✅ Ensure that your service's workflow has a "Accept ConversationWorkflow Activity which starts the "GetOnNewTasksTrigger Event.

  1. Add a "GetOnNewTasks" Nimbus activity to your flow.
  2. Retrieve the "MicrosoftCallerID and check in your CRM if the caller is known.   
    ☝ Since we have limited API calls it makes sense to check internally first and limit the external requests.
  3. ONLY when the caller is not found in your CRM we want to make a request on → See next step.

Make API Request

✅ Here we assume your internal CRM did yield no results.

  1. Add a HTTP request to with your previously created variables.  
    1. OPTIONALLY you can also check if the request has been successful status=200 and react accordingly. Note that Nimbus will not wait for any flow results while a call is handled, so you might want to skip out of the flow early with a token error to keep response times short.  
      💡 Related Tip: You can also store return values in Nimbus parameters in case you want to react to a status or redirect "unknown" callers. See our Use Case - Storing external CRM data in custom parameters.
  2. Store the response "Body" from the HTTP request in a "Compose" element  

Here is an example API return body:

Show an example Luware-Response

<?xml version="1.0" encoding="utf-8" ?>
                                <feed xml:lang="de" xmlns="" xmlns:openSearch="" xmlns:tel="">
                                 <title type="text"> API Search Results</title>
                                 <generator version="1.0" uri=""></generator>
                                 <link href="" rel="alternate" type="text/html" />
                                 <link href="" type="application/atom+xml" rel="self" />
                                 <openSearch:Query role="request" searchTerms="05840428 " startPage="1"></openSearch:Query>
                                 <openSearch:Image height="1" width="1" type="image/gif"></openSearch:Image>
                                 <title type="text">Luware AG</title>
                                 <content type="text">Luware AG
                                 Hardturmstrasse 127
                                 8005 Zürich ZH
                                 *058 404 28 00</content>
                                 <link href="" title="Details" rel="alternate" type="text/html" />
                                 <link href="" type="text/x-vcard" title="VCard Download" rel="alternate" />
                                 <link href="" rel="edit" type="text/html" />
                                 <tel:name>Luware AG</tel:name>
                                 <tel:copyright>Daten: Swisscom Directories AG</tel:copyright>

Check the response data

✅ If no entries are found, then the response data 

1. Create a second "Compose" Element and rename it to “HasRecords”.

2. Store the totalResults value by setting Inputs to this expression

xpath(xml(outputs('Compose')), '/*[name()="feed" and namespace-uri()=""]//*[name()="openSearch:totalResults"][1]/text()')

3. Add a condition and check on the Outputs of “HasRecords”. It should not be 0.

💡 If they are "false", then there are not entries in the response and we can leave the flow.

→ In the next step we retrieve the interesting parts from that message.

Retrieve missing data from the response

✅ The response will not quite match what we need. To get the missing data from the response (DisplayName) we need to filter out the necessary details using Xpath queries.

1. Set a new variable (e.g. DisplayName)

2. Query the value from the response body with an Xpath expression on the "compose" object from the previous step:

xpath(xml(outputs('Compose')), '/*[name()="feed" and namespace-uri()=]//*[name()="content"][1]/text()')

💡 You can generate your own Xpath expression according to your needs. You can test the expression with a tool like 

Some examples to get data from the reponse XML



Output from example xml


normalize-space((/*[name()="feed" and namespace-uri()=""]//*[name()="content"])[1]/text())) Content node text without line breaks Luware AG
Hardturmstrasse 127
8005 Zürich ZH
*058 404 28 00

Update Nimbus parameter


/*[name()="feed" and namespace-uri()=""]//*[name()="tel:type" and namespace-uri()=""][1]

Tel:type node

Value is either Organisation or Person



Use for conditional checks in the workflow

/*[name()="feed" and namespace-uri()=""]//*[name()="tel:name” and namespace-uri()=""][1] Tel:name node Luware AG

Update Nimbus parameter


/*[name()="feed" and namespace-uri()=""]//*[name()="tel:copyright" and namespace-uri()=""][1] Tel:copyright node Daten: Swisscom Directories AG


Use for update the source field in your CRM system

/*[name()="feed" and namespace-uri()=""]//*[name()="tel:country" and namespace-uri()=""][1] Tel:country node ch

Update Nimbus parameter



When done you can store the output into one - or several variables - and update Nimbus with the retrieved information → See next step.

Update the Nimbus Task

✅ Assuming that your previous data retrieval was successful it's now time to let Nimbus know about it so the caller info is also shown in the UI.

  1. Store the "Xpath" query results in your previously initialized variables.
  2. Add an Nimbus "UpdateTask" action to the end of your flow.
  3. Map the variables (e.g. DisplayName) to the corresponding Nimbus parameters.  

Table of Contents