ERPGulf / ultramsg_4_ERPNext

App for Frappe ERPNext to send Whatsapp message using service provider ultramsg.com
Other
1 stars 9 forks source link

Error while Sending Notifications #4

Closed moizsami closed 2 months ago

moizsami commented 2 months ago

Hello,

I am using the app on V15 ERPNext.

I have entered the details in 'whatsapp message' doctype

I created a notification with selecting channel as whatsapp

I am receiving the bleow error when notification is sent.

Traceback (most recent call last):
  File "env/lib/python3.11/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/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)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "apps/ultramsg_4_erpnext/ultramsg_4_erpnext/overrides/notification.py", line 85, in send_whatsapp_without_pdf
    response_json = response.json()
                    ^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
moizsami commented 2 months ago

Hi,

Any way to fix this ? I tried another site which is hosted on frappe cloud and one hosted on self hosted server, both having same error

moizsami commented 2 months ago

Apologies from my side, as per the documentation provided I was copy pasting the message and document url in settings.

The url has to be as per your own instance which we can get from ultramsg.

After updating url it works fine