php - Nexmo voice call not working -
i have tried execute text speech api in nexmo error:
$phoneno = "checkthisout"; $params = "api_key=xxxx&api_secret=xxxxx&to=xxxxx&from=xxxxxx&text=".$phoneno; $url = 'https://api.nexmo.com/tts/json?'; . http_build_query($params); $ch = curl_init($url); curl_setopt($ch, curlopt_returntransfer, true); $response = curl_exec($ch); print_r($response);
but got new error {"status":"2","error_text":"missing username"}
done per url : https://nexmo.github.io/quickstarts/tts/.
i have checked document. don't see such error text. me please?
as marc mentioned, expects array parameters, rather string
$params = [ 'api_key' => xxxxx, 'api_secret' => xxxxx, 'to' => your_number, 'from' => nexmo_number, 'text' => 'checkthisout', ]; $url = 'https://api.nexmo.com/tts/json?' . http_build_query($params); $ch = curl_init($url); curl_setopt($ch, curlopt_returntransfer, true); $response = curl_exec($ch);
you can watch video quick walkthrough: text speech quickstart video
full discolsure, work @ nexmo.
here more detailed documentation on how implement text speech
Comments
Post a Comment