> For the complete documentation index, see [llms.txt](https://multisource.gitbook.io/multisource-integration-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://multisource.gitbook.io/multisource-integration-api/integration/call-lookup/3cx-integration.md).

# 3CX Integration

Connect **Call Lookup** to 3CX so that inbound calls automatically display the caller's name and company in the 3CX Web Client, desktop app, and mobile app.

### Prerequisites

* Your 3CX license must include CRM integrations. If **Integrations → CRM** doesn't offer a template upload option, this feature isn't included in your current 3CX plan — check with 3CX or your 3CX partner to confirm which tier you need.
* Works identically across all 3CX deployment models — **on-premise**, **self-hosted** (Azure, AWS, Google Cloud, DigitalOcean), and **Hosted by 3CX**.
* A valid multisource•api **Auth-Key**.

### How it works

3CX supports custom CRM integrations through a server-side XML template. The template tells 3CX which URL to query for an incoming caller's number, and how to map the JSON response to 3CX's built-in contact card. No external service or proxy is needed — 3CX calls the multisource•api directly.

### Installation

1. In the 3CX Admin Console, go to **Integrations → CRM**.
2. Click **+ Add Template** and upload the template file below.
3. Select **multisource Call Lookup** from the CRM solution dropdown.
4. Enter your multisource•api Auth-Key.
5. Click **Save**.
6. Test the integration using the built-in **TEST** button with a phone number listed on search.ch or local.ch. Example: 0800 86 80 86

![](/files/RgxnxqZzrUWBgozve0Y4)![](/files/WnsVKELrEusSJWfWDfZx)

### Template

{% file src="/files/lvm7jUcwxkgixMw4JJXj" %}

```xml
<?xml version="1.0"?>
<Crm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Country="CH" Name="multisource Call Lookup" Version="1" SupportsEmojis="false">
<Number Prefix="AsIs" MaxLength="15" />
<Connection MaxConcurrentRequests="5" />
<Parameters>
<Parameter Name="ApiKey" Type="Password" Parent="General Configuration" Editor="String" Title="multisource API Key (Auth-Key):" Validation="" Default="" ListValues="" RequestUrl="" RequestUrlParameters="" ResponseScenario="" />
</Parameters>
<Authentication Type="No" />
<Scenarios>
<Scenario Id="" Type="REST" EntityId="" EntityOrder="">
<Request SkipIf="" Url="https://api.multisource.ch/v2/search/calllookup?number=[Number]" MessagePasses="0" Message="" RequestContentType="" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json">
<Headers>
<Value Key="Auth-Key" Passes="0" Type="String">[ApiKey]</Value>
</Headers>
</Request>
<Rules>
<Rule Type="Any" Ethalon="">result.data.dwhId</Rule>
</Rules>
<Variables>
<Variable Name="ContactID" LookupValue="" Path="result.data.dwhId">
<Filter />
</Variable>
<Variable Name="FirstName" LookupValue="" Path="result.data.firstname">
<Filter />
</Variable>
<Variable Name="LastName" LookupValue="" Path="result.data.name">
<Filter />
</Variable>
<Variable Name="Company" LookupValue="" Path="result.data.companyname">
<Filter />
</Variable>
<Variable Name="Email" LookupValue="" Path="result.data.email">
<Filter />
</Variable>
<Variable Name="MobileFirst" LookupValue="" Path="result.data.mobileNumbers">
<Filter>
<Rule Type="Number">result.data.mobileNumbers</Rule>
</Filter>
</Variable>
<Variable Name="PhoneFirst" LookupValue="" Path="result.data.phoneNumbers">
<Filter>
<Rule Type="Number">result.data.phoneNumbers</Rule>
</Filter>
</Variable>
</Variables>
<Outputs Next="" AllowEmpty="false">
<Output Type="FirstName" Passes="0" Value="[FirstName]" />
<Output Type="LastName" Passes="0" Value="[LastName]" />
<Output Type="CompanyName" Passes="0" Value="[Company]" />
<Output Type="Email" Passes="0" Value="[Email]" />
<Output Type="ContactUrl" Passes="0" Value="[ContactID]" />
<Output Type="PhoneMobile" Passes="0" Value="[IIf([MobileFirst]!=&quot;&quot;,[Number],&quot;&quot;)]" />
<Output Type="PhoneBusiness" Passes="0" Value="[IIf([MobileFirst]==&quot;&quot;,[Number],&quot;&quot;)]" />
</Outputs>
</Scenario>
</Scenarios>
</Crm>
```

### Field mapping

| 3CX field                       | multisource•api source           | Notes                                                                                                                                   |
| ------------------------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `FirstName`                     | `firstname`                      |                                                                                                                                         |
| `LastName`                      | `name`                           |                                                                                                                                         |
| `CompanyName`                   | `companyname`                    |                                                                                                                                         |
| `Email`                         | `email`                          |                                                                                                                                         |
| `ContactUrl`                    | `dwhId`                          | Unique ID of the entry at multisource•api.                                                                                              |
| `PhoneMobile` / `PhoneBusiness` | `mobileNumbers` / `phoneNumbers` | The template checks which array contains the number that was actually searched, and maps it to the corresponding 3CX field accordingly. |

### Known limitations

The following limitations in 3CX are known:

* **No address fields.** 3CX's contact card for phone lookups has no street/postal code/city fields at all — `street`, `houseNumber`, `zip`, and `location` from the API response cannot be surfaced anywhere in the call popup.
* **No explicit Person/Company flag.** 3CX computes this internally and it cannot be overridden by a template. In practice this doesn't matter: a private match populates `FirstName`/`LastName`, a business match populates `CompanyName`, and 3CX displays accordingly.
