$id_user = $id_user_result['data']['id'];
// Define the new callerid value
$newCallerID = '1234';
// Update the caller ID
$updateResult = $magnusBilling->update('user', $id_user, ['callerid' => $newCallerID]);
// Display the result of the update operation
echo "Update Result: " . print_r($updateResult, true) . PHP_EOL;
} else {
echo "Failed to get user ID. Error: " . $id_user_result['message'] . PHP_EOL;
echo "Details: " . print_r($id_user_result, true) . PHP_EOL;
Hi there,
I am trying yo update the caller id but every time its throwing as error as "Failed to get user ID"
below is my script
<?php
require_once "vendor/autoload.php";
use magnusbilling\api\magnusBilling;
// MagnusBilling API Configuration
$magnusBilling = new MagnusBilling('6966608921:AAFhgWEe123423gfvfdcdcd', '232@6966608921:AAFhgWEe123423gfvfdcdcd');
$magnusBilling->public_url = "http://xyz.com/mbilling"; // Your MagnusBilling URL
//get ID for username 24320
$id_user_result = $magnusBilling->getId('user', 'username', '24320');
// Check the result for more details
echo "ID Retrieval Result: " . print_r($id_user_result, true) . PHP_EOL;
// Check the result for more details
echo "ID Retrieval Result: " . print_r($id_user_result, true) . PHP_EOL;
// Check if the ID retrieval was successful
if ($id_user_result['status'] === 'success') {
} else {
}
Please suggest if i am doing something wrong.
Thanks in advance