How to use 3CX web API

The only API currently available for 3CX is the Call Control API, and you need to develop your own program and call the 3CX wrapped methods to achieve the functionality you want.

We found someone on GitHub who has wrapped the 3CX Call Control API as a Web API for external use. The project address is:

Download Web API

3CX V16 use .net core 3.1, and 3CX V18 use .NET5. So you need to download the corresponding version according to your needs. The project is using V16 version by default. Download the V18 version to switch to the V18 branch and download it.

Press green button Code download zip.

If 3cx run in a Linux Server you can use git clone to download these things to the server. First you need to install git on your Linux server.

V16 3CX command:

V18 3CX command:

Installation Environment

Please Follow Mircrosoft guide to install .NET environment:

Download .net core 3.1 for V16, .NET 5 for V18.

Linux Server please follow this guide:

Check installation status run this command:

Deploy Web API

Here we demonstrate how to deploy it for Linux, for Windows please refer to the documentation on the project homepage.

First of all, move to 3cx-web-API directory:

Modify WebAPICore.csproj file:

  • remove <Private>false</Private> in for 3cxpscomcpp2
  • edit path: <HintPath>..\..\..\Program Files\3CX Phone System\Bin\3cxpscomcpp2.dll</HintPath> to <HintPath>/usr/lib/3cxpbx/3cxpscomcpp2.dll</HintPath>

Before edit:

After edit:

After modify, run command:

Change directory to bin/Debug/net5.0:

Also we need copy 3CXPhoneSystem.ini file to this directory:

Now we need to disable Debian buster’s firewall:

Run Web API Server in port 8888(default port is 8889):

If we want to check extension 805 status, we can access below link in browser:

We can see current status is available: