I use the sendinblue
API (Github Link) to send sms but I get this error:
[400] Error connecting to the API (https://api.sendinblue.com/v3/transactionalSMS/sms)
My relevant code:
/**
* @Route("/send", name="cron.send.sms")
*/
public function sendSms()
{
$listSms = $this->smsRespository->findSmsToSend();
$config = Configuration::getDefaultConfiguration()
->setApiKey('api-key', $this->getParameter('SENDINBLUE_API_KEY'));
$apiInstance = new TransactionalSMSApi(
null,
$config
);
$sendTransacSms = new SendTransacSms(['sender'=> 'med','recipient'=> '+21620005579','content'=>'bonjour']);
// print_r($sendTransacSms);
try {
dd($apiInstance->sendTransacSms($sendTransacSms));
$result = $apiInstance->sendTransacSms($sendTransacSms);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->createContact: ', $e->getMessage(), PHP_EOL;
}
}
Can anyone assist?