Commit da2ce84d authored by Helperhaps's avatar Helperhaps

add status message api

parent 5c624eef
......@@ -12,3 +12,6 @@ def receivede():
def users():
report.get_users("DAY","2016-04-10","3")
def status():
report.get_status_messages('3289406737', ['xxx'])
......@@ -75,7 +75,7 @@ __all__ = [
schedulepayload,
]
__version__ = '3.3.3'
__version__ = '3.3.4'
VERSION = tuple(map(int, __version__.split('.')))
# Silence urllib3 INFO logging by default
......
......@@ -22,6 +22,19 @@ class Report(object):
received = self.send("GET", url, params = params)
return received
def get_status_messages(self, msg_id, reg_ids, date=None):
url = common.get_url('report', self.zone) + 'status/messages'
if not isinstance(reg_ids, list):
reg_ids = [reg_ids]
body = {
'msg_id': msg_id,
'registration_ids': reg_ids
}
if date is not None:
body['date'] = date
sm = self.send("POST", url, body = body)
return sm
def get_messages(self, msg_ids):
url = common.get_url('report', self.zone) + 'messages'
params = { 'msg_ids': msg_ids }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment