caronc/apprise

Support: Wxpusher

codejiangqihan opened this issue · 10 comments

📢 What is the name of the service?

🔗 Provide some details about the service that can help with it's development.

💡 Anything else?
This is a service I am using. It can send information in the form of a WeChat official account message to WeChat. I hope it can be supported.

@codejiangqihan have a look at the PR listed above and give it a test run if you wouldn't mind? I would appreciate your feedback.

I tried, and the command executed successfully, but no messages were received on WeChat. I tested using a MacOS virtual machine outside mainland China, which may have caused the issue due to network reasons. Further testing is needed.

I tried, and the command executed successfully, but no messages were received on WeChat. I tested using a MacOS virtual machine outside mainland China, which may have caused the issue due to network reasons. Further testing is needed.

Hmm, are you using WeChat or WxPusher? I made some more changes. Can you pull the latest branch (follow link above) and give it another try?

Hmm, are you using WeChat or WxPusher? I made some more changes. Can you pull the latest branch (follow link above) and give it another try?

Wxpusher is a tool for sending messages to WeChat (specifically to their official WeChat public account). I tested it, but it still doesn't work. The error message is: "2024-06-02 23:44:31,244 - WARNING - Failed to send WxPusher notification: error=200." The message was not pushed to their official WeChat public account. The command I used is:
apprise -vv -t "Test Message Title" -b "Test Message Body" -n failure
wxpusher://appToken/UID

@codejiangqihan hmm, strange. When you specific the UID, you prefix it with UID_

If you run with -vvv, you will receive more debugging information. I feel that we are close!

Tip: > wxpusher://AT_/UID_
2024-06-05 22:10:16,038 - DEBUG - Could not load translation path: /Users/runner/work/mac/mac/apprise/lib/python3.12/site-packages/apprise/i18n/en
2024-06-05 22:10:16,154 - DEBUG - Notification Plugin 106(s) and 151 Schema(s) loaded in 0.1142s
2024-06-05 22:10:16,155 - DEBUG - Loaded WxPusher URL: wxpusher://****/UID_/?format=text&overflow=upstream&rto=4.0&cto=4.0&verify=yes
2024-06-05 22:10:16,155 - DEBUG - WxPusher POST URL: https://wxpusher.zjiecode.com/api/send/message (cert_verify=True)
2024-06-05 22:10:16,155 - DEBUG - WxPusher Payload: {'appToken': 'AT_
', 'content': 'Test Message Body', 'summary': 'Test Message Title', 'contentType': 0, 'topicIds': [], 'uids': ['UID_*****'], 'verifyPay': False, 'verifyPayType': 0, 'url': None}
2024-06-05 22:10:16,941 - WARNING - Failed to send WxPusher notification: error=200.
2024-06-05 22:10:16,941 - DEBUG - Response Details:
{'code': 1001, 'msg': 'contentType错误', 'data': None, 'success': False}

I made some subtle changes, I'm not sure if they helped out at all. Maybe give it another try? Make sure to grab the latest changes.

I can't find any source (well in English anyway) that can help me diagnose the error you're seeing. I feel I've followed the documentation properly, but there must be something I'm missing...

I made some subtle changes, I'm not sure if they helped out at all. Maybe give it another try? Make sure to grab the latest changes.

I can't find any source (well in English anyway) that can help me diagnose the error you're seeing. I feel I've followed the documentation properly, but there must be something I'm missing...
This is the current error message:
2024-06-17 10:22:09,261 - DEBUG - Notification Plugin 106(s) and 151 Schema(s) loaded in 0.0806s
2024-06-17 10:22:09,262 - DEBUG - Loaded WxPusher URL: wxpusher://****/UID_/?format=text&overflow=upstream&rto=4.0&cto=4.0&verify=yes
2024-06-17 10:22:09,262 - DEBUG - WxPusher POST URL: https://wxpusher.zjiecode.com/api/send/message (cert_verify=True)
2024-06-17 10:22:09,262 - DEBUG - WxPusher Payload: {'appToken': 'AT_
', 'content': 'Test Message Body', 'summary': 'Test Message Title', 'contentType': 0, 'topicIds': [], 'uids': ['UID_*****'], 'verifyPay': False, 'url': None}
2024-06-17 10:22:09,779 - WARNING - Failed to send WxPusher notification: error=200.
2024-06-17 10:22:09,779 - DEBUG - Response Details:
{'code': 1001, 'msg': 'contentType错误', 'data': None, 'success': False}

I have a project request method as follows. Use POST to make a request. The request URL is https://wxpusher.zjiecode.com/api/send/message The request body is:{"appToken":"AT_","topicIds":[],"content":"****","contentType":"1","uids":["UID_"]}

I got a list of the error codes, in your example, it was 1001 which points that the token provided is invalid. Here a the other codes:

  • 1000: Success. The request was processed successfully.
  • 1001: Token is empty. The token provided in the request is missing.
  • 1002: Token is invalid. The token provided in the request is incorrect or expired.
  • 1003: The message content is empty. The body of the message was not provided.
  • 1004: User or topic not found. The user or topic you're trying to send the message to does not exist
  • 1005: App or topic binding failed. The app or topic binding process failed.
  • 1006: Message sending failed. There was an error in sending the message.
  • 1007: Excessive message length. The message content exceeds the allowed length.
  • 1008: Sending frequency is too high. The API call frequency is too high and the server rejected the request.
  • 1009: Sending failed due to other reasons. There might be other issues that are not explicitly covered by the above codes
  • 1010: IP address is not in the whitelist. The IP address making the request is not whitelisted.

This is now done. Closing issue