Reputation: 342
Framework: Laravel 4.2
API: Nexmo
Library: christian-giupponi/nexmo https://github.com/ChristianGiupponi/Laravel-4-Nexmo
I have already deposit $10 in my account which means its not demo anymore.
<?php
$response = Nexmo::sendSMS('Amazon Company', $text_data['contact_number'], $text_data['text']);
$response = json_decode($response);
if(isset($response->body->messages[0]->{'error-text'}))
{
return array(
'status' => 'fail',
'response' => $response->body->messages[0]->{'error-text'}
);
}
return array(
'status' => 'success'
);
?>
My research:
Upvotes: 1
Views: 2120
Reputation: 1178
To send SMS to US numbers, You have to request short code or you have to registered long number. For more details you can check my answer on following link:
https://stackoverflow.com/a/33035811/3077339
Hope this will help you.
Upvotes: 2
Reputation: 17624
In the US you can only use a Nexmo virtual number as the sender, see this helpdesk article. From the code you posted it looks like you're using '1FX Cash'
, which would be rejected.
My guess is that you're getting the Error code 15 - Illegal Sender
error.
Upvotes: 1
Reputation: 653
Is this a brand new Nexmo account? By default when you first sign up you can only send text messages to the phone number you registered with. You'll need to contact their support to request the restriction to be removed before you can send to others. I think you can do that here: https://help.nexmo.com/hc/en-us/requests/new
Upvotes: 0