0

I'm working on an application that sends SMS to the customers we got.

I'm currently looking the doc (https://docs.ovh.com/fr/sms/envoyer_des_sms_avec_lapi_ovh_en_php/) => it's in french.

They're using a PHP Wrapper, but I really don't know how I can integrate the API to my Laravel Project.

Does someone know how it's working ?

Rahul
  • 18,271
  • 7
  • 41
  • 60
Petoux
  • 108
  • 1
  • 1
  • 11

2 Answers2

0

First of all, install the package

composer require ovh/php-ovh-sms

Then, on the controller, you can use the API easily as stated in the documentation.

use \Ovh\Sms\SmsApi;

// Informations about your application
// You may set them to 'NULL' if you are using
// a configuraton file
$applicationKey = "your_app_key";
$applicationSecret = "your_app_secret";
$consumerKey = "your_consumer_key";
$endpoint = 'ovh-eu';

// Init SmsApi object
$Sms = new SmsApi( $applicationKey, $applicationSecret, $endpoint, $consumerKey );

// Get available SMS accounts
$accounts = $Sms->getAccounts();
dd($accounts);

Adlan Arif Zakaria
  • 1,706
  • 1
  • 8
  • 13
0

There is a Laravel notification channel specifically for this provider, this will make the whole process much easier, it will allow you to use Laravel's built in notifications functionality without having to write provider specific code.

http://laravel-notification-channels.com/ovh-sms/

Joe
  • 4,618
  • 3
  • 28
  • 35