magnussolution/magnusbilling-api

Unable to update caller id

Opened this issue · 4 comments

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

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') { $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; } Please suggest if i am doing something wrong. Thanks in advance

Did you find it?

Not yet. facing issue with user authentication.
By any chance do you have any solution?

Yes add me on discord konotop

my discord : kshontop