Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Uncaught Error: Class "Vonage\Message\Viber\ViberText" not found in /home/zvanywebadmin/public_html/vishnuapi/index.php:26 Stack trace: #0 {main} thrown in /home/zvanywebadmin/public_html/vishnuapi/index.php on line 26 #96

Open
vishnuchoudhary2822 opened this issue Nov 28, 2023 · 0 comments

Comments

@vishnuchoudhary2822
Copy link

`<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

require_once 'vendor/autoload.php';

use Vonage\Client;
use Vonage\Client\Credentials\Keypair;

// Set your Vonage API credentials
$apiKey = 'xxxxx';
$apiSecret = 'xxxxx';
$applicationId = 'xxxxxxxxx';
$privateKeyPath = './private.key'; // Path to your private key file

// Create Vonage API client
$credentials = new Keypair($apiKey, $privateKeyPath);
$client = new Client($credentials);

// Set the recipient and sender numbers
$toNumber = 'xxxxxxxxx'; // Replace with the recipient's Viber number
$fromNumber = 'xxxxxxxxxx'; // Replace with your Viber number associated with the application

// Create Viber text message
$viber = new \Vonage\Message\Viber\ViberText(
$toNumber,
$fromNumber,
'This is a text message sent using the Vonage PHP SDK'
);

// Send the Viber message
$response = $client->message()->send($viber);

// Handle the response
if ($response->getStatus() == 0) {
echo 'Viber message sent successfully!';
} else {
echo 'Error sending Viber message. Error code: ' . $response->getMessages()[0]->getStatus();
`}``

Screenshot 2023-11-28 at 7 00 55 PM

Need help Can you Please check my what's the issue

I want to send messages through Vonage WhatsApp API. but it's showing error below

Fatal error: Uncaught Error: Class "Vonage\Message\Viber\ViberText" not found in /home/zvanywebadmin/public_html/vishnuapi/index.php:26 Stack trace: #0 {main} thrown in /home/zvanywebadmin/public_html/vishnuapi/index.php on line 26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant