api: Implement GET /messages/<message_id>.
This commit is contained in:
parent
e2f379675b
commit
38f3e1a9f5
|
@ -697,6 +697,16 @@ class Client(object):
|
|||
request=message_filters
|
||||
)
|
||||
|
||||
def get_raw_message(self, message_id):
|
||||
# type: (int) -> Dict[str, str]
|
||||
'''
|
||||
See examples/get-raw-message for example usage
|
||||
'''
|
||||
return self.call_endpoint(
|
||||
url='messages/{}'.format(message_id),
|
||||
method='GET'
|
||||
)
|
||||
|
||||
def send_message(self, message_data):
|
||||
# type: (Dict[str, Any]) -> Dict[str, Any]
|
||||
'''
|
||||
|
|
21
zulip/zulip/examples/get-raw-message
Executable file
21
zulip/zulip/examples/get-raw-message
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import argparse
|
||||
|
||||
import zulip
|
||||
|
||||
usage = """get-raw-message <message_id> [options]
|
||||
|
||||
|
||||
Example: get-raw-message 42
|
||||
"""
|
||||
|
||||
|
||||
parser = zulip.add_default_arguments(argparse.ArgumentParser(usage=usage))
|
||||
parser.add_argument('message_id', type=int)
|
||||
options = parser.parse_args()
|
||||
|
||||
client = zulip.init_from_options(options)
|
||||
|
||||
print(client.get_raw_message(options.message_id))
|
Loading…
Reference in a new issue