Nexmo / nexmo-laravel

Add Vonage functionality such as SMS and voice calling to your Laravel app with this Laravel Service Provider.
MIT License
318 stars 79 forks source link

cUrl 6.0 error #17

Closed segunmicheal27 closed 6 years ago

segunmicheal27 commented 6 years ago

After install the library here is the following i got

cURL error 6: Could not resolve host: rest.nexmo.com (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

after request

mheap commented 6 years ago

Hi @segunmicheal27, thanks for reaching out (and sorry for the delay getting back to you)

That error indicates that your machine cannot reach rest.nexmo.com. The endpoint is working fine from my machine. Could you try again to make sure that it wasn't a temporary issue?

If you still can't connect, we can try and work it out together

Cheers, Michael

segunmicheal27 commented 6 years ago

i think there is issue with guzzle http, i use another curl library to make the request and it went through

let me try it again but i was trying it on my localhost

segunmicheal27 commented 6 years ago

i am still experiencing same error i am using laravel 5.5 run with phpstorm IDE i am 100% sure that all my credential are all correct

mheap commented 6 years ago

Could you share code and/or explain what you're trying to accomplish so that I can try and replicate the issue?

segunmicheal27 commented 6 years ago

okay

public function sendSMS($message){

    Nexmo::message()->send([
        'to'   => '2348154967721',
        'from' => '2348154967721',
        'text' => $message
    ]);
}

and here is my route

Route::get('/send/sms/{message}', 'UsersController@sendSMS')->name('send_sms');

mheap commented 6 years ago

@segunmicheal27 I just ran this code on Laravel 5.5 (changing to/from to my number) and received the message as expected.

Which versions of the following are you using?

segunmicheal27 commented 6 years ago

i am using laravel 5.5 "nexmo/client": "^1.1", "nexmo/laravel": "1.0.2"

the Guzzle version that come laravel

i guess Guzzle 6.30

segunmicheal27 commented 6 years ago

please can you share ur code sample here or paste bin

mheap commented 6 years ago

I've uploaded the project to https://github.com/mheap/nexmo-laravel-test

You'll need to copy .env.example to .env and add your Nexmo credentials. You'll also have to change to/from in UsersController

segunmicheal27 commented 6 years ago

i am getting error Non White-listed Destination - rejected

mheap commented 6 years ago

@segunmicheal27 Are you sending a message your own phone number that you provided to Nexmo to test?

segunmicheal27 commented 6 years ago

yes

mheap commented 6 years ago

@segunmicheal27 To confirm, have you followed these instructions? https://help.nexmo.com/hc/en-us/articles/204014853-Nexmo-trial-period-How-to-add-numbers-to-list-of-permitted-destinations-