ln / threecx
v0.0.9
2025-01-20 21:28 UTC
Requires
- guzzlehttp/guzzle: ^7.9
- spomky-labs/otphp: ^10.0
README
package to wrap the api of 3cx®
- first steps: https://www.3cx.com/docs/configuration-rest-api/
- openapi documentation: https://downloads-global.3cx.com/downloads/misc/restapi/3cxconfigurationapi.yaml
getting started
composer require ln/threecx
usage
conf
you need the FQDN of the instanz, username and password (with permissions for the action)
$client = new Client(new Host(string <fqdn>, int <port>, bool <debug, optional>)); $client->setUser(new User(string <username>, string <password>, string <mfa, optional>)); // or $client->setRest(new Rest(string <clientId>, string <clientSecret>)); // or $client->setToken(new Token(string <tokenType>, int <expires>, string <accessToken>, string <refreshToken>));
functions
get
$client->get(string <uri>, array <query>)
delete
$config->delete(string <uri>, array <query>)
post, put, patch
$config-><post|put|patch>(string <uri>, array <payload>, array <query>)