Integrating with web based CRM via the HTTP API
3CX PhoneSystem also provides the facility to control extension operations via an HTTP API that is simple to use, and therefore ideal for simple integration into a web-based custom application.
The functions available are:
- Make a call from an Extension to any number (may be internal or external)
- Disable an Extension
- Enable an Extension
- Disable External Calls for an Extension
- Enable External Calls for an Extension
- Disable Call Recording for an Extension
- Enable Call Recording for an Extension
Each of the functions requires an HTTP post with a particular format. These examples will require the items in column 1 to be changed, as follows:
| <pbx> | IP ADDRESS OF 3CX PHONE SYSTEM MACHINE |
| <ext> | EXTENSION NUMBER |
| <destination> | DESTINATION NUMBER TO DIAL |
| <ext_pin> | THE PIN NUMBER FOR THE EXTENSION |
| <pbxpass> | THE PASSWORD FOR THE 3CX MANAGEMENT CONSOLE |
Make Call (V10)
| http://<pbx>:5000/ivr/PbxAPI.aspx?func=make_call&from=<ext>&to=<dest>&pin=<ext_pin> |
Disable Extension (V10)
| http://<pbx>:5000/ivr/PbxAPI.aspx?func=upd_ext&ext_num=<ext>&pwd=<pbxpass>&disable=1 |
Enable Extension (V10)
| http://<pbx>:5000/ivr/PbxAPI.aspx?func=upd_ext&ext_num=<ext>&pwd=<pbxpass>&disable=0 |
Disable External Calls for an Extension (V10)
| http://<pbx>:5000/ivr/PbxAPI.aspx?func=upd_ext&ext_num=<ext>&pwd=<pbxpass>&disable_external=1 |
Enable External Calls for an Extension (V10)
| http://<pbx>:5000/ivr/PbxAPI.aspx?func=upd_ext&ext_num=<ext>&pwd=<pbxpass>&disable_external=0 |
Disable Call Recording for an Extension (V10)
| http://<pbx>:5000/ivr/PbxAPI.aspx?func=upd_ext&ext_num=<ext>&pwd=<pbxpass>&record_calls=0 |
Enable Call Recording for an Extension (V10)
| http://<pbx>:5000/ivr/PbxAPI.aspx?func=upd_ext&ext_num=<ext>&pwd=<pbxpass>&record_calls=1 |
Concatenation: You can pass more than one instruction – lets say I want extension 100 to be disabled from making external calls and recording enabled. The command would look like this using 3CX PhoneSystem V10:
http://10.172.0.15:5000/ivr/PbxAPI.aspx?func=upd_ext&extnum=100&pwd=admin&disable=0&disable_external=1&record_calls=1
Relevant details for 3CX PhoneSystem V9 below this line
Make Call (V9)
| http://<pbx>:5484/PbxAPI.aspx?func=make_call&from=<ext>&to=<dest>&pin=<ext_pin> |
Disable Extension (V9)
| http://<pbx>:5484/PbxAPI.aspx?func=upd_ext&ext_num=<ext>&pwd=<pbxpass>&disable=1 |
Enable Extension (V9)
| http://<pbx>:5484/PbxAPI.aspx?func=upd_ext&ext_num=<ext>&pwd=<pbxpass>&disable=0 |
Disable External Calls for an Extension (V9)
| http://<pbx>:5484/PbxAPI.aspx?func=upd_ext&ext_num=<ext>&pwd=<pbxpass>&disable_external=1 |
Enable External Calls for an Extension (V9)
| http://<pbx>:5484/PbxAPI.aspx?func=upd_ext&ext_num=<ext>&pwd=<pbxpass>&disable_external=0 |
Disable Call Recording for an Extension (V9)
| http://<pbx>:5484/PbxAPI.aspx?func=upd_ext&ext_num=<ext>&pwd=<pbxpass>&record_calls=0 |
Enable Call Recording for an Extension (V9)
| http://<pbx>:5484/PbxAPI.aspx?func=upd_ext&ext_num=<ext>&pwd=<pbxpass>&record_calls=1 |
Concatenation: You can pass more than one instruction – lets say I want extension 100 to be disabled from making external calls and recording enabled. The command would look like this using 3CX PhoneSystem V9:
http://10.172.0.15:5484/PbxAPI.aspx?func=upd_ext&extnum=100&pwd=admin&disable=0&disable_external=1&record_calls=1
In Version 9 when Abyss web server is used, the links should look like the example below
http://<pbx>:5481/ivr/PbxAPI.aspx?func=upd_ext&ext_num=<ext>&pwd=<pbxpass>&disable_external=0
http://<pbx>:5481/ivr/PbxAPI.aspx?func=make_call&from=<ext>&to=<dest>&pin=<ext_pin>
NOTE: PBX:5481/ivr – this is because Abyss is configured to use virtual directories unlike IIS
.
You can see a simple example (works only on IIS) of how the 3CX API was used here..
(Launch this link in your browser, and then select the “View Source” menu option. This will demonstrate a simple example of how to programmatically achieve integration with 3CX Phone System.)