Hi, new user here working though API to backfill Splynx with existing end-client info/services as we migrate off another platform. I have been trying to run the Voice Services - Create Service thru PHP (with the SplynxAPI.php library) but keep getting an HTTP 500 error back from the API call - from the Nginx level logs I’m getting it as an ‘Unknown Component ID’ but has anyone seen anything like this before? Definitely rusty at the PHP level but I know the SSL is getting through (managed to use the CDR import API OK) but I think the basic call is OK:
//$locationsApiUrl = "admin/customers/customer/".$data_row['clientid']."/voice-service";
$locationsApiUrl = "admin/customers/customer/9994/voice-service";
$result = $api->api_call_post($locationsApiUrl, [
//'customer_id' => $data_row['clientid'],
'customer_id' => 9994,
'tariff_id' => 16, // for + Voicemail
'status' => 'active',
'description' => $data_row['comment'],
'quantity ' => 1,
'unit' => 0,
'unit_price' => 0,
'start_date' => '2018-01-01',
'end_date' => '0000-00-00',
'discount' => '',
'discount_percent' => 0,
'discount_start_date' => '',
'discount_end_date' => '',
'discount_text' => '',
'voice_device_id' => 0,
'phone' => $data_row['phonenum'] ] );
$data_row is coming from a MySQL instance; I’m hard coding 9994 for testing as I know that customer exists
Any assistance gratefully received!
Max
New Zealand
In the nginx/splynx_err log I get
thrown in /var/www/splynx/app/di/ComponentLocator.php on line 30" while reading response header from upstream, client: X.X.X.X, server: splynx, request: “POST /api/1.0/admin/customers/customer/9994/voice-service HTTP/1.1”, upstream: “fastcgi://unix:/var/run/splynx-php5-fpm.sock:”, host: “xxx.yyy.co.nz” 2019/02/26 12:38:43 [error] 23023#23023: *289875 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught exceptions\InvalidConfig: Unknown component ID: authManager in /var/www/splynx/app/di/ComponentLocator.php:30
Stack trace:
#0 /var/www/splynx/app/BaseApp.php(345): di\ComponentLocator->get(‘authManager’)
#1 /var/www/splynx/app/web/Controller.php(216): BaseApp->getAuthManager()
#2 /var/www/splynx/app/base/Controller.php(91): web\Controller->checkAccess()
#3 /var/www/splynx/app/core/Router.php(304): base\Controller->runAction(404)
#4 /var/www/splynx/app/core/Router.php(252): core\Router->callError()
#5 /var/www/splynx/app/core/Router.php(150): core\Router->run()
#6 /var/www/splynx/app/ApiApp.php(16): core\Router->dispatchApiRequest()
#7 /var/www/splynx/web/api.php(13): ApiApp->run()
#8 {main}