Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vonage.errors.AuthenticationError: Authentication failed. Check you're using a valid authentication method. #145

Open
AbrahamMialma opened this issue Apr 17, 2023 · 2 comments

Comments

@AbrahamMialma
Copy link

AbrahamMialma commented Apr 17, 2023

Hola tengo este error : vonage.errors.AuthenticationError: Authentication failed. Check you're using a valid authentication method.

Linux xubuntu 22.04

Python 3.10

pip3 install vonage

Cuando trato de ejecutar el siguiente codigo :

#################################### Codigo #############################################

import os
from os.path import join, dirname

VONAGE_APPLICATION_ID = "f6e2b6af-2610-408d-99f9-c41e2248e03d"
VONAGE_APPLICATION_PRIVATE_KEY_PATH = "/home/android/Proyectos/Corato_V2/private.key"

TO_NUMBER = **********
FROM_NUMBER = **********

import vonage

client = vonage.Client(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_APPLICATION_PRIVATE_KEY_PATH,

)

client.messages.send_message({

"channel": "whatsapp",
"message_type": "text",
"to": "**********",
"from": "***********",
"text": "This is a WhatsApp text message sent using the Vonage Messages API",

})

-----https://github.com/Vonage/vonage-python-code-snippets/blob/main/messages/whatsapp/send_text.py

$ python3 send_text.py

#######################################################################################

Ya intente con key y secret pero no funciona, que estoy haciendo mal ???

Gracias de antemano.

Stack trace :

Traceback (most recent call last):
File "/home/android/Downloads/ejemplos_vonage/messages/whatsapp/send_text.py", line 23, in
client.messages.send_message(
File "/home/android/Downloads/ejemplos_vonage/env/lib/python3.10/site-packages/vonage/messages.py", line 25, in send_message
return self._client.post(
File "/home/android/Downloads/ejemplos_vonage/env/lib/python3.10/site-packages/vonage/client.py", line 231, in post
return self.parse(
File "/home/android/Downloads/ejemplos_vonage/env/lib/python3.10/site-packages/vonage/client.py", line 277, in parse
raise AuthenticationError("Authentication failed. Check you're using a valid authentication method.")

@OoElMaxioO
Copy link

OoElMaxioO commented May 19, 2023

Hola, ¿pudiste solucionar el problema? Estoy teniendo prácticamente la misma limitante que tú y la documentación no dice nada al respecto.

@maxkahan
Copy link
Contributor

Question was asked and answered here: Vonage/vonage-python-sdk#257

To use WhatsApp as a message channel for the Messages API, you must first register a WhatsApp Business Account to be associated with the WhatsApp messages you send. WhatsApp also have to verify that your business is legitimate, which gives you a green tick. You can read more about this here: https://developer.vonage.com/en/messages/concepts/whatsapp

You can register for a WhatsApp account with Vonage in the developer dashboard.

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants