3cx Restful API / Web API

Status
Not open for further replies.

sjsteve33171

Bronze Partner
Advanced Certified
Joined
Aug 22, 2019
Messages
2
Reaction score
9
Those asking for a Restful API or Web API, here is my version in PHP. Many people here asking for help, many people here responding with "It's there go look" which isn't helpful.

I've provided this "AS IS", feel free to use as you wish! Enjoy courtesy of StepTech Solutions Ltd!

I came across this as I was both drunk and bored. Edited my Linux version of 3cx web dir and looked in all the .js files. Searched for "/api/" and found what was needed. Post to /api/login/ and store the returned cookie, post the cookie with each variable after.

Tested many times with POSTMAN before coding it. Those charging should be providing for free! If you can understand this code you're smart enough to use for free!

3cx Web API - Pastebin.com
 
Well done :)
 
1. Is it possible to get the path to the call recording through the web api?

2. Uncommented Call Log but returns an empty array. Why?
otrsveter - Xshell 6 (Free for HomeSchool).jpg
192.168.1.1073cxapi.php - Google Chrome.jpg
 
Hi,

1. Unsure, not looked into it too deeply but given enough info to get people started.
2. if you echo $CallLog->CallLogRows it shows an "Array".

Start by dumping the vars using

print_r( $CallLog->CallLogRows );

To see the array list and grab from there. If it's still empty, I'm unsure as all this does is return what's given by the PBX API.
 
Del my comment
 
Last edited:
I've been reverse engineering the API for a bit, so it's nice to see someone else do it. SO much more functionality we can put in it. @Nick Galea , is 3CX changing the API to use WebSockets (Specifically messagepack) instead of a RESTful of API?
 
  • Like
Reactions: ChrisKoll
This looks pretty interesting. Thank you @sjsteve33171 for sharing.
Just had a quick look at it. Can you confirm, this only offers some generic commands for the server?

Didn't saw anything that let my manage a concrete extension / user (subscribe and unsubscribe to ring queues, change status, change status name etc.).
 
I am working on a full feature system that will have most of the 3cx system available to control, However some commands should done at the PBX level and not from the API, will have a working demo very soon.
 
  • Like
Reactions: snits35m
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,324
Messages
591,897
Members
165,475
Latest member
lastshadow