# Ansible: Need to send the text message (SMS) via ansible using the “Nexmo”. Getting below error

**URL:** <https://forum.ansible.com/t/ansible-need-to-send-the-text-message-sms-via-ansible-using-the-nexmo-getting-below-error/24548>\
**Category:** Ansible Project\
**Created:** [May 23, 2017, 11:20am UTC](https://forum.ansible.com/t/ansible-need-to-send-the-text-message-sms-via-ansible-using-the-nexmo-getting-below-error/24548 "2017-05-23T11:20:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nishant\_bawane](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@nishant\_bawane](https://forum.ansible.com/u/nishant_bawane)\
**Post date:** [May 23, 2017, 11:20am UTC](https://forum.ansible.com/t/ansible-need-to-send-the-text-message-sms-via-ansible-using-the-nexmo-getting-below-error/24548/1 "2017-05-23T11:20:06Z")

</div>

Below is the playbook which is used to send the messages to the registered numbers using nexmo. Please suggests what needs to be done to overcome this error - No which i used are registered one and same with the api inputs.

---

<div class="post-metadata">

**Author:** ![nishant\_bawane](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@nishant\_bawane](https://forum.ansible.com/u/nishant_bawane)\
**Post date:** [June 6, 2017, 2:27pm UTC](https://forum.ansible.com/t/ansible-need-to-send-the-text-message-sms-via-ansible-using-the-nexmo-getting-below-error/24548/2 "2017-06-06T14:27:09Z")

</div>

Is there any soln to overcome this error, please suggest the right forum to ask this question, if this is not the correct forum.

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [June 6, 2017, 3:07pm UTC](https://forum.ansible.com/t/ansible-need-to-send-the-text-message-sms-via-ansible-using-the-nexmo-getting-below-error/24548/3 "2017-06-06T15:07:46Z")

</div>

I’ve just tested this module to validate that it is working correctly, and it seems to be.

I’m not sure what specific issue you are running into.

I might suggest following the example on the getting started page for Nexmo, and using your same data:

curl -X POST [https://rest.nexmo.com/sms/json](https://rest.nexmo.com/sms/json)   
-d api\_key=640c8a53   
-d api\_secret=0ce239a6   
-d to=919168694888   
-d from=8793161930   
-d text=“Hello from Nexmo”

Of course, you need to replace api\_key and api\_secret with your key and secret.

---

<div class="post-metadata">

**Author:** ![nishant\_bawane](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@nishant\_bawane](https://forum.ansible.com/u/nishant_bawane)\
**Post date:** [June 6, 2017, 5:36pm UTC](https://forum.ansible.com/t/ansible-need-to-send-the-text-message-sms-via-ansible-using-the-nexmo-getting-below-error/24548/4 "2017-06-06T17:36:44Z")

</div>

Hello Matt,

Thanks a lot for your input, Really Appreciated!

I tried to make the changes in my playbook as per below -

---

<div class="post-metadata">

**Author:** ![nishant\_bawane](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@nishant\_bawane](https://forum.ansible.com/u/nishant_bawane)\
**Post date:** [June 14, 2017, 10:09am UTC](https://forum.ansible.com/t/ansible-need-to-send-the-text-message-sms-via-ansible-using-the-nexmo-getting-below-error/24548/5 "2017-06-14T10:09:09Z")

</div>

even i have tried using the twilo still not able to get the output -

- hosts: localhost  
tasks:
- name: Send notification message via twilio  
twilio:  
msg: ‘Hello from Nishant via Ansible’  
account\_sid: ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  
auth\_token: a0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  
from\_number: +918793127307  
to\_number: +919168612880  
delegate\_to: localhost

below is the error-

fatal: [localhost → localhost]: FAILED! =\> {“changed”: false, “failed”: true, “msg”: “Failed to validate the SSL certificate for [api.twilio.com:443](http://api.twilio.com:443). Make sure your managed systems have a valid CA certificate installed. If the website serving the url uses SNI you need python \>= 2.7.9 on your managed machine or you can install the urllib3, pyopenssl, ndg-httpsclient, and pyasn1 python modules to perform SNI verification in python \>= 2.6. You can use validate\_certs=False if you do not need to confirm the servers identity but this is unsafe and not recommended. Paths checked for this platform: /etc/ssl/certs, /etc/pki/ca-trust/extracted/pem, /etc/pki/tls/certs, /usr/share/ca-certificates/cacert.org, /etc/ansible”}
