#!/usr/bin/env python3importpero# Pass the path to your perorc file here.client=pero.Client(config_file="~/.perorc")# Get the edit history for a message, given the message's ID.result=client.get_message_history(message_id)print(result)
The -u line implements HTTP Basic authentication.
See the Authorization header documentation for how
to get those credentials for users and bots.
Will be null only for edit history
events predating March 2017.
Clients can display edit history events where this
is null as modified by either the sender (for content
edits) or an unknown user (for topic edits).
content_html_diff: string
Only present if message's content was edited.
An HTML diff between this version of the message
and the previous one.
timestamp: integer
The UNIX timestamp for this edit.
Please note that the original message's snapshot only contains the fields
topic, content, rendered_content, timestamp and user_id. This
snapshot will be the only one present if the message has never been edited.
Also note that each snapshot object will only contain additional data for the
modified fields for that particular edit (e.g. if only the topic or channel
was edited, prev_content, prev_rendered_content, and
content_html_diff will not appear).
Example response(s)
Changes: As of Zulip 7.0 (feature level 167), if any
parameters sent in the request are not supported by this
endpoint, a successful JSON response will include an
ignored_parameters_unsupported array.
A typical successful JSON response may look like:
{"message_history":[{"content":"Hello!","rendered_content":"<p>Hello!</p>","timestamp":1530129122,"topic":"party at my houz","user_id":5},{"content":"Howdy!","content_html_diff":"<div><p><span class=\"highlight_text_inserted\">Howdy!</span></p> <p><span class=\"highlight_text_deleted\">Hello!</span></p></div>","prev_content":"Hello!","prev_rendered_content":"<p>Hello!</p>","prev_topic":"party at my houz","rendered_content":"<p>Howdy!</p>","timestamp":1530129134,"topic":"party at my house","user_id":5}],"msg":"","result":"success"}
An example JSON response for when the specified message does not exist: