leogomezz4t / PyTextNow_API

Python texting API utilizing TextNow API
MIT License
67 stars 41 forks source link

Status Code: 400 "Could not send message." #45

Closed ovr-hit closed 2 years ago

ovr-hit commented 2 years ago

After sending one message with the new 1.1.8 update, started getting the "Could not send message." error again. Tried resetting auth, logged in and out and replaced the new cookies. Still didn't work.

Also, when I installed with pip no "user_cookies.json" file was included in the package. Had to add it myself, not sure if this is a problem on my end or not.

Here's the simple program I used:

import pytextnow
import os

sid = os.environ['sid']
csrf = os.environ['csrf']
number = os.environ['number']

client = pytextnow.Client("is037412", sid_cookie=sid, csrf_cookie=csrf)

client.send_sms(number, "Hello World!")
leogomezz4t commented 2 years ago

I fixed the user_cookies.json but I ran the program and the it worked fine and sent the message. This may be a dumb questions but is the number you put there, 'is037412" the actual number you're using. If so then it probably won't accept that format

leogomezz4t commented 2 years ago

Either way I pushed the fix for the user_cookies.json to github and pypi

ovr-hit commented 2 years ago

I fixed the user_cookies.json but I ran the program and the it worked fine and sent the message. This may be a dumb questions but is the number you put there, 'is037412" the actual number you're using. If so then it probably won't accept that format

is037412 is my username on textnow.

leogomezz4t commented 2 years ago

right sorry. anyway the new patch is online see if it works now

ovr-hit commented 2 years ago

Thanks!! I'll run it in a few hours when I'm free.