From 8319264a624a21f894ba09ec3b633d48bbfbad8c Mon Sep 17 00:00:00 2001 From: RaymondYao <45799780+YongquanYao@users.noreply.github.com> Date: Wed, 24 Nov 2021 15:32:31 -0500 Subject: [PATCH 1/2] fix invalid parameter issue of get_status_mesage. --- jpush/report/core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jpush/report/core.py b/jpush/report/core.py index b79b077..83d6855 100644 --- a/jpush/report/core.py +++ b/jpush/report/core.py @@ -29,6 +29,7 @@ def get_received_detail(self, msg_ids): return response def get_status_message(self, msg_id, reg_ids, date=None): + import json url = common.get_url('report', self.zone) + 'status/message' if not isinstance(reg_ids, list): reg_ids = [reg_ids] @@ -38,6 +39,7 @@ def get_status_message(self, msg_id, reg_ids, date=None): } if date is not None: body['date'] = date + body = json.dumps(body) sm = self.send("POST", url, body = body) return sm From 4453844e9cbf3df42f229b30ec5a22a046e181fb Mon Sep 17 00:00:00 2001 From: RaymondYao <45799780+YongquanYao@users.noreply.github.com> Date: Wed, 24 Nov 2021 16:09:30 -0500 Subject: [PATCH 2/2] feat report_example.py --- examples/report_example.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/report_example.py b/examples/report_example.py index 0f52875..89a5b7e 100644 --- a/examples/report_example.py +++ b/examples/report_example.py @@ -21,7 +21,9 @@ def users(): report.get_users("DAY","2016-04-10","3") def status(): - report.get_status_message('3289406737', ['xxx']) + msgid = '3289406737' + regid = 'xxx' + report.get_status_message(int(msgid), [regid]) messages_detail() received_detail() \ No newline at end of file