-
Notifications
You must be signed in to change notification settings - Fork 35
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
Getting JSONDecodeError on invalid response from API #49
Comments
Good afternoon!
In a line of code: |
@MominIqbal-1234 Thanks for submitting the issue. The bug has been fixed in version |
2024-03-12 22:15:04:whatsapp-api-client-python:ERROR:Request was failed with status code: 401. Data: |
Which method returns a 401 error? Please describe the problem in more detail in the technical support channel:
|
Status 401 indicates that you have a problem with your instance or token. You probably did not change the initial instance and token. You can get your data in your Green API account, API url and Media url fields for sending media files. |
Traceback (most recent call last):
File "/workspaces/whatsapp-api-client-python/main.py", line 15, in
main()
File "/workspaces/whatsapp-api-client-python/main.py", line 9, in main
response = greenAPI.sending.sendMessage("11001234567@c.us", "Message text")
File "/workspaces/whatsapp-api-client-python/whatsapp_api_client_python/tools/sending.py", line 32, in sendMessage
return self.api.request(
File "/workspaces/whatsapp-api-client-python/whatsapp_api_client_python/API.py", line 93, in request
self.__handle_response(response)
File "/workspaces/whatsapp-api-client-python/whatsapp_api_client_python/API.py", line 117, in __handle_response
json.loads(response.text), ensure_ascii=False, indent=4
File "/home/codespace/.python/current/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/home/codespace/.python/current/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/codespace/.python/current/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The text was updated successfully, but these errors were encountered: