Skip to main content

api.newMessage

api.newMessage(messagetype)

Description

Creates and returns an empty message that can be edited and then published.

Parameters

ParameterTypeExplanation
messagetypeStringThe message_type of the message (located in headers/metadata)

Example

msg = api.newMessage("HelloMessageType")
msg.put("text", "Hello world")
api.publish(msg)