leogomezz4t / PyTextNow_API

Python texting API utilizing TextNow API
MIT License
69 stars 42 forks source link

Status Code: 401 #18

Closed moistwrist3 closed 3 years ago

moistwrist3 commented 3 years ago
from pytextnow import TNAPI

client = TNAPI.Client("XXXXXXXXXX", cookie="sid")
client.auth_reset()
client.send_sms("+555 XXX XXXX", "Hello")
client.auth_reset()

Error 401

Open application tab and copy connect.sid cookie and paste it here. connect.sid: XXXXX Traceback (most recent call last): File "c:\Users\User\Desktop\API\PyTextNow_API\pytextnow\sms.py", line 7, in client.send_sms("+555 XXX XXXX", "Hello") File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\pytextnow\TNAPI.py", line 201, in send_sms raise self.FailedRequest(str(response.status_code)) pytextnow.TNAPI.FailedRequest: Could not send message. server returned a Client error. Request Failed. Try resetting your authentication with client.auth_reset() Status Code: 401

moistwrist3 commented 3 years ago

Found the solution. I was using the wrong email

syed4frendz commented 1 year ago

I am using the below code, I used gmail as my authentication client = TNAPI.Client(sender_email,password) client.auth_reset()

client.send_sms(receiver_num,email_info)

why does it always ask for SID. Itry sid from developer tools get the below error: expected string or bytes-like object, got 'tuple'

in email I use my xxx@gmail.com

Kasherpete commented 1 year ago

I am using the below code, I used gmail as my authentication client = TNAPI.Client(sender_email,password) client.auth_reset() #client.send_sms(receiver_num,email_info)

why does it always ask for SID. Itry sid from developer tools get the below error: expected string or bytes-like object, got 'tuple'

in email I use my xxx@gmail.com

When you use client.auth_reset(), you will need to supply different credentials because it resets the auth tokens. However, I think that PyTextNow is broken due to TextNow blocking bots, making the website more complicated, and adding captchas. This may have changed, so try to remove client.auth_reset() and uncomment client.send_sms(). If this does not work, PyTextNow is still broken.