Render message

Render a message to HTML.

POST https://zulip.dioco.io/api/v1/messages/render

Usage examples

#!/usr/bin/env python3

import zulip

# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/zuliprc")

# Render a message
request = {
    'content': '**foo**',
}
result = client.render_message(request)
print(result)

More examples and documentation can be found here.

const Zulip = require('zulip-js');

// Pass the path to your zuliprc file here.
const config = { zuliprc: 'zuliprc' };

Zulip(config).then(async (client) => {
    // Render a message
    const params = {
        content: "**foo**",
    };

    return await client.messages.render(params);
}).then(console.log).catch(console.err);

curl -sSX POST https://zulip.dioco.io/api/v1/messages/render \
    -u BOT_EMAIL_ADDRESS:BOT_API_KEY \
    -d 'content=Hello'

Parameters

content required

Example: Hello

The content of the message. Maximum message size of 10000 bytes.


Response

Return values

  • rendered: The rendered HTML.

Example response

A typical successful JSON response may look like:

{
    "msg": "",
    "rendered": "<p><strong>foo</strong></p>",
    "result": "success"
}