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 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